[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Tyrant Client?
- From: Bertrand Mansion <lua@...>
- Date: Fri, 3 Jul 2009 08:23:41 +0200
On Fri, Jul 3, 2009 at 1:07 AM, Phoenix Sol<email@example.com> wrote:
> Thank-you, Petite. I will implement Tyrant's binary protocol in Lua.
> Phoenix Sol
> On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille <firstname.lastname@example.org>
>> On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote:
>>> Anybody have a Lua client for Tokyo Tyrant?
>> "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)."
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: