lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks a lot, Bertrand.


On Jul 3, 2009, at 1:23 AM, Bertrand Mansion <lua@mamasam.net> wrote:

On Fri, Jul 3, 2009 at 1:07 AM, Phoenix Sol<phoenix@burninglabs.com> wrote:
Thank-you, Petite.  I will implement Tyrant's binary protocol in Lua.

Respectfully,
Phoenix Sol


On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille <petite.abeille@gmail.com >
wrote:

On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote:

Anybody have a Lua client for Tokyo Tyrant?

HTTP?

"As for the HTTP/1.1 compatible protocol, the server implements the
following commands; "GET" (relevant to `tcrdbget'), "HEAD" (relevant to
`tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to
`tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of each request is treated as the key encoded by the URL encoding. And the entity body is
treated as the value. However, headers except for "Connection" and
"Content-Length" are ignored. "PUT" can have the header "X-TT- PDMODE" whose
value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to
`tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should have the header "X-TT-XNAME" whose value stands for the function name to be called. "POST" can have the header "X-TT-XOPTS" whose value stands for bitwise-or
options of 1 (record locking) and 2 (global locking)."

http://tokyocabinet.sourceforge.net/tyrantdoc/

I think the http interface does not perform as well as the binary one
and does not allow you to do everything that Tokyo Tyrant proposes.

I have written a PHP version of the binary protocol which is complete
and up-to-date. FYI, the Python version is not up-to-date. If you want
a model to get inspiration, either use my PHP implementation or the
Perl or Ruby ones.

You can find my code here:
http://mamasam.indefero.net/p/tyrant/


--
Bertrand Mansion
Mamasam