reusing sockets between Perl memcached objects

2010-03-12 Thread Jonathan Swartz
We make liberal use of the namespace option to Cache::Memcached::libmemcached, creating one object for each of our dozens of namespaces. However I recently discovered that it will create new socket connections for each object. i.e.: #!/usr/bin/perl -w use Cache::Memcached; use strict;

Re: reusing sockets between Perl memcached objects

2010-03-12 Thread dormando
We discovered this as well a few months ago... I don't think we found a workaround :( Maybe someone else has? On Fri, 12 Mar 2010, Jonathan Swartz wrote: We make liberal use of the namespace option to Cache::Memcached::libmemcached, creating one object for each of our dozens of namespaces.

Re: reusing sockets between Perl memcached objects

2010-03-12 Thread Jonathan Swartz
The way I would solve this would be to change Cache::Memcached::libmemcached to *contain* a Memcached::libmemcached object (go from ISA to HAS-A), and forward all methods appropriately. Then multiple C::M::l objects could share the same M::l object. Other than the ref() of the object,