NAME
Catalyst::Model::Tarantool
SYNOPSIS
MyApp.pm
use Catalyst::Model::Tarantool;
__PACKAGE__->config(
servers => "127.0.0.1:33013",
name => "users", # mostly used for debug purposes
spaces => [
{
indexes => [
{
index_name => 'id', # num
keys => [0],
}, {
index_name => 'user_name', # str
keys => [0],
}, {
index_name => 'first_name', # str
keys => [0],
}, {
index_name => 'last_name', # str
keys => [0],
} ],
space => 0, # space id, as set in Tarantool/Box config
name => "primary", # self-descriptive space-id
format => "l&&&", # pack()-compatible, Qq must be supported by perl itself, see perldoc -f pack
# & stands for byte-string, $ stands for utf8 string.
default_index => 'id',
fields => [qw/ id user_name first_name last_name /], # turn each tuple into hash, field names according to format
}
],
default_space => "primary",
timeout => 1, # seconds, not float!
retry => 3,
debug => 9, # output to STDERR some debugging info
raise => 1, # dont raise an exception in case of error
);
MyApp::Controller::Root sub index :Path :Args(0) { my ( $self, $c ) = @_; my $tnt = $c->model('TNT')->handler; my $tuple = $tnt->Select( 1 ); # hashref $c->stash(tuple => $tuple); }
DESCRIPTION
Tarantool interface for Catalyst based application
SEE ALSO
Want more? MR::Tarantool::Box.
AUTHOR
Alexey Orlov, <aorlov@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Alexey Orlov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.