Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #754
Difficulty: Medium
EEPROM stands for electronic erasable programmable read-only memory.
True or False?
Linux & Unix Commands - Search Man Pages

dr::tarantool(3pm) [debian man page]

DR::Tarantool(3pm)					User Contributed Perl Documentation					DR::Tarantool(3pm)

NAME
DR::Tarantool - perl driver for tarantool <http://tarantool.org> SYNOPSIS
use DR::Tarantool ':constant', 'tarantool'; use DR::Tarantool ':all'; my $tnt = tarantool host => '127.0.0.1', port => 123, spaces => { ... } ; $tnt->update( ... ); my $tnt = coro_tarantool host => '127.0.0.1', port => 123, spaces => { ... } ; use DR::Tarantool ':constant', 'async_tarantool'; async_tarantool host => '127.0.0.1', port => 123, spaces => { ... }, sub { ... } ; $tnt->update(...); DESCRIPTION
The module provides sync and async drivers for tarantool <http://tarantool.org>. The driver uses libtarantool* libraries for making requests and parsing responses. EXPORT
tarantool connects to tarantool <http://tarantool.org> in sync mode using DR::Tarantool::SyncClient. async_tarantool connects to tarantool <http://tarantool.org> in async mode using DR::Tarantool::AsyncClient. coro_tarantol connects to tarantool <http://tarantool.org> in async mode using DR::Tarantool::CoroClient. :constant Exports constants to use in request as flags: TNT_FLAG_RETURN If You use the flag, driver will return tuple that were inserted/deleted/updated. TNT_FLAG_ADD Try to add tuple. Return error if tuple is already exists. TNT_FLAG_REPLACE Try to replace tuple. Return error if tuple isn't exists. :all Exports all functions and constants. SEE ALSO
The module uses DR::Tarantool::SyncClient and (or) DR::Tarantool::AsyncClient. COPYRIGHT AND LICENSE
Copyright (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. VCS
The project is placed git repo on github: https://github.com/unera/dr-tarantool/ <https://github.com/unera/dr-tarantool/>. perl v5.14.2 2012-06-06 DR::Tarantool(3pm)

Check Out this Related Man Page

DR::Tarantool::AsyncClient(3pm) 			User Contributed Perl Documentation			   DR::Tarantool::AsyncClient(3pm)

NAME
DR::Tarantool::AsyncClient - async client for tarantool <http://tarantool.org> SYNOPSIS
use DR::Tarantool::AsyncClient 'tarantool'; DR::Tarantool::AsyncClient->connect( host => '127.0.0.1', port => 12345, spaces => { 0 => { name => 'users', fields => [ qw(login password role), { name => 'counter', type => 'NUM' } ], indexes => { 0 => 'login', 1 => [ qw(login password) ], } }, 2 => { name => 'roles', fields => [ qw(name title) ], indexes => { 0 => 'name', 1 => { name => 'myindex', fields => [ 'name', 'title' ], } } } } sub { my ($client) = @_; ... } ); $client->ping(sub { ... }); $client->insert('space', [ 'user', 10, 'password' ], sub { ... }); $client->call_lua(foo => ['arg1', 'arg2'], sub { }); client->select('space', 1, sub { ... }); $client->delete('space', 1, sub { ... }); $client->update('space', 1, [ passwd => set => 'abc' ], sub { .. }); Class methods connect Connects to <tarantool:http://tarantool.org>, returns (by callback) object that can be used to make requests. DR::Tarantool::AsyncClient->connect( host => $host, port => $port, spaces => $spaces, reconnect_period => 0.5, reconnect_always => 1, sub { my ($obj) = @_; if (ref $obj) { ... # handle errors } ... } ); Arguments host & port Address where tarantool is started. spaces A hash with spaces description or DR::Tarantool::Spaces reference. reconnect_period & reconnect_always See DR::Tarantool::LLClient for more details. Attributes space Returns space object by name (or by number). See perldoc DR::Tarantool::Spaces for more details. Worker methods All methods receive callbacks that will receive the following arguments: status If success the field will have value 'ok'. tuple(s) or code of error If success, the second argument will contain tuple(s) that extracted by request. errorstr Error string if error was happened. sub { if ($_[0] eq 'ok') { my ($status, $tuples) = @_; ... } else { my ($status, $code, $errstr) = @_; } } ping Pings server. $client->ping(sub { ... }); Arguments cb insert Inserts tuple into database. $client->insert('space', [ 'user', 10, 'password' ], sub { ... }); $client->insert('space', @tuple, $flags, sub { ... }); Arguments space_name tuple flags (optional) Flag list described in perldoc ":constant" in DR::Tarantool. callback call_lua Calls lua function. All arguments translates to lua as strings (As is). Returned tuples can be unpacked by space or by format. $client->call_lua(foo => ['arg1', 'arg2'], sub { }); $client->call_lua(foo => [], 'space_name', sub { ... }); $client->call_lua(foo => @args, flags => $f, space => $space_name, sub { ... } ); $client->call_lua(foo => @args, fields => [ qw(a b c) ], sub { ... } ); $client->call_lua(foo => @args, fields => [ qw(a b c), { type => 'NUM', name => 'abc'} ... ], sub { ... } ); Arguments function name function arguments space name or the other optional arguments callback Optional arguments space Space name. Use the argument if Your function returns tuple(s) from a described in connect space. fields Output fields format (like 'fields' in connect method). flags Reserved option. args Argument fields format. select Selects tuple(s) from database. $tuples = $client->select('space', 1, sub { ... }); $tuples = $client->select('space', [1, 2], sub { ... }); $tuples = $client->select('space_name', [1,2,3] => 'index_name', sub { ... }); Arguments space name key(s) optional arguments callback optional arguments The section can contain only one element: index name, or hash with the following fields: index index name or number limit offset delete Deletes tuple. $client->delete('space', 1, sub { ... }); $client->delete('space', $key, $flags, sub { ... }); Arguments space name key flags (optional) Flag list described in perldoc ":constant" in DR::Tarantool. callback update Updates tuple. $client->update('space', 1, [ passwd => set => 'abc' ], sub { .. }); $client->update( 'space', 1, [ [ passwd => set => 'abc' ], [ login => 'delete' ] ], sub { ... } ); Arguments space name key operations list flags (optional) Flag list described in perldoc ":constant" in DR::Tarantool. callback COPYRIGHT AND LICENSE
Copyright (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. VCS
The project is placed git repo on github: https://github.com/unera/dr-tarantool/ <https://github.com/unera/dr-tarantool/>. perl v5.14.2 2012-06-04 DR::Tarantool::AsyncClient(3pm)

Featured Tech Videos