https://github.com/mons/protocol-tarantool
Protocol implementation for Tatantool
https://github.com/mons/protocol-tarantool
Last synced: 10 months ago
JSON representation
Protocol implementation for Tatantool
- Host: GitHub
- URL: https://github.com/mons/protocol-tarantool
- Owner: Mons
- Created: 2012-10-15T14:09:45.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-12-12T15:11:32.000Z (over 11 years ago)
- Last Synced: 2023-03-24T05:25:04.497Z (about 3 years ago)
- Language: C
- Size: 1.51 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Protocol::Tarantool - Binary protocol of Tarantool/Box database
SYNOPSIS
use Protocol::Tarantool;
my $key1 = [ 'value1','value2' ];
my $key2 = [ 'value3','value4' ];
my $tuple = [ 1,2'data',3,'moredata'];
# Pack request packets
my $packet = Protocol::Tarantool::select( $req_id, $sp_no, $idx_no, $offset, $limit, [ $key1, $key2 ]);
my $packet = Protocol::Tarantool::insert( $req_id, $sm_no, $flags, $tuple);
my $packet = Protocol::Tarantool::delete( $req_id, $sm_no, $flags, $tuple);
my $packet = Protocol::Tarantool::lua( $req_id, $flags, $function_name, [ $arg1, $arg2, $arg3 ]);
# Unpack response packet
# detect total size of packet by first bytes of header (need first 8 bytes). Return -1 if not enough data
my $size_of_packet = Protocol::Tarantool::peek_size( \$packet );
my $response = Protocol::Tarantool::response( $packet );
EXPORT
None by default.
SEE ALSO
AnyEvent::Tarantool - AnyEvent client that uses this protocol
DR::Tarantool - Another sync and async implementation
MR::Tarantool::Box - First client by Mail.Ru
AUTHOR
Mons Anderson
LICENSE
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
COPYRIGHT
Copyright 2012 Mons Anderson, Mail.ru, all rights reserved.