![]() |
![]()
| ![]() |
![]()
NAMEDR::Tarantool::LLClient - a low level async client for Tarantool <http://tarantool.org>SYNOPSISDR::Tarantool::LLClient->connect( host => '127.0.0.1', port => '33033', cb => { my ($tnt) = @_; ... } ); $tnt->ping( sub { .. } ); $tnt->insert(0, [ 1, 2, 3 ], sub { ... }); $tnt->select(1, 0, [ [ 1, 2 ], [ 3, 4 ] ], sub { ... }); $tnt->update(0, [ 1 ], [ [ 1 => add pack 'L<', 1 ] ], sub { ... }); $tnt->call_lua( 'box.select', [ 0, 1, 2 ], sub { ... }); DESCRIPTIONThis module provides a low-level interface to Tarantool <http://tarantool.org>.METHODSAll methods receive callback as the last argument. The callback receives HASHREF value with the following fields:
If you use NUM or NUM64 field types, values for these fields need to be packed before they are sent to the server, and unpacked when received in a response. This is a low-level driver :) connectCreates a connection to TarantoolDR::Tarantool::LLClient->connect( host => '127.0.0.1', port => '33033', cb => { my ($tnt) = @_; ... } ); Arguments
is_connectedTrue if this connection is established.connection_statusContains a string with the status of connection. Return value can be:
pingPing the server.$tnt->ping( sub { .. } ); Arguments
insertInsert a tuple.$tnt->insert(0, [ 1, 2, 3 ], sub { ... }); $tnt->insert(0, [ 4, 5, 6 ], $flags, sub { .. }); Arguments
selectSelect a tuple or tuples.$tnt->select(1, 0, [ [ 1, 2 ], [ 3, 4 ] ], sub { ... }); $tnt->select(1, 0, [ [ 1, 2 ], [ 3, 4 ] ], 1, sub { ... }); $tnt->select(1, 0, [ [ 1, 2 ], [ 3, 4 ] ], 1, 2, sub { ... }); Arguments
updateUpdate a tuple.$tnt->update(0, [ 1 ], [ [ 1 => add 1 ] ], sub { ... }); $tnt->update( 0, # space [ 1 ], # key [ [ 1 => add 1 ], [ 2 => add => 1 ], # operations $flags, # flags sub { ... } # callback ); $tnt->update(0, [ 1 ], [ [ 1 => add 1 ] ], $flags, sub { ... }); Arguments
deleteDelete a tuple.$tnt->delete( 0, [ 1 ], sub { ... }); $tnt->delete( 0, [ 1 ], $flags, sub { ... }); Arguments
call_luaCalls a lua procedure.$tnt->call_lua( 'box.select', [ 0, 1, 2 ], sub { ... }); $tnt->call_lua( 'box.select', [ 0, 1, 2 ], $flags, sub { ... }); Arguments
last_codeReturn code of the last request or undef if there was no request.last_error_stringAn error string if the last request ended up with an error, or undef otherwise.LoggingThe module can log requests/responses. Logging can be turned ON by setting these environment variables:
COPYRIGHT AND LICENSECopyright (C) 2011 Dmitry E. Oboukhov <unera@debian.org> Copyright (C) 2011 Roman V. Nikolaev <rshadow@rambler.ru> This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License. VCSThe project is placed git repo on github: <https://github.com/dr-co/dr-tarantool/>.
|