[Gambas-devel] gb.memcached

Sebastian Kulesz sebikul at ...176...
Wed Sep 26 06:50:29 CEST 2012


Hi!

In rev 5206 i added a memcached client. It's fully implemented and
works perfect, except for one thing, i only managed to store strings
:(

It's not that i could not store other datatypes, in fact, it can
(strings are easy to debug), but the memcached server relies in the
client to send the byte size of the data it has to store, which proved
to be really hard to calculate. It should be trivial to also implement
other native datatypes (i.e. integers, floats, etc) with a *really
big* if structure. But the problem was with arrays and collections.
Although the interpreter can serialize the objects, i *previously*
need to send the byte size of the blob.

If you look at the code, you will see that in the Store() function i
hard coded an if statement to calculate the offset based on the length
of the string (using the "Binary Data Representation" wiki page [0] ).
The same could be done with integers, for example, but couldn't find a
way to do this for objects.

My question is: Would it be possible to expose the (de)serialization
functions and return the blob as an utf-8 string? It would then be
trivial to implement the rest

In the meantime, you are free to play only with strings ;)

Thanks!

[0] http://gambasdoc.org/help/cat/datarep?v3




More information about the Devel mailing list