libmemcache(3) 1.1.0rc4...

Sean Chittenden sean at chittenden.org
Mon Dec 20 14:02:31 PST 2004


Howdy y'all.  Wanted to drop a quick note that rc4 is available.  It 
includes a few important bits:

http://people.FreeBSD.org/~seanc/libmemcache/

*) Long line requests/responses are finally working correctly (thought 
I'd fixed this earlier, but hadn't).  Thanks to John McCaskey for his 
patches and test cases.

*) New callback interface.

*) Added a ChangeLog w/ complete history of the libraries 
endeavors/travels.


The callback interface is nifty and I think other language interfaces 
may want to implement their own version of it.  Essentially what it 
does is let you piggy back get requests so that there's only one get 
request that gets sent across the wire even though different parts of 
code need their bits.  I'll let people's imagination run with how this 
could be used, but I'm finding it to be exceedingly handy in reducing 
the number of actual get requests made.  Look in regress.c (at the 
bottom) or memcache.h for an example.  Enjoy.


static void my_callback(MCM_CALLBACK_SIG);
static void
my_callback(MCM_CALLBACK_FUNC) {
   struct memcache_res *res = MCM_CALLBACK_RES;
...
}

   req = mc_req_new();
   res = mc_req_add(req, "callback", MCM_CSTRLEN("callback"));
   mc_res_register_fetch_cb(req, res1, my_callback, NULL);

-sc

-- 
Sean Chittenden



More information about the memcached mailing list