I think is excellent as long as Memcache is thread safe and I assume it is.
On Sep 13, 10:13 am, zahariash <[email protected]> wrote: > Hello, > > I don't think, that thread pool is necessary. MemcacheClient module do > synchronous requests, so it needs one socket/thread to not block > web2py threads by each other. This is done by using > threading.local... > So maybe lets try: > -------- CUT --------- > --- __init__.py.bak 2009-05-22 06:44:03.000000000 +0200 > +++ __init__.py 2009-09-13 16:46:44.000000000 +0200 > @@ -9,7 +9,12 @@ > > import cPickle as pickle > > -class MemcacheClient(Client): > +def MemcacheClient(*a, **b): > + if not hasattr(MemcacheClient, '__mc_instance'): > + MemcacheClient.__mc_instance = _MemcacheClient(*a, **b) > + return MemcacheClient.__mc_instance > + > +class _MemcacheClient(Client): > def __init__(self, request, servers, debug=0, pickleProtocol=0, > pickler=pickle.Pickler, unpickler=pickle.Unpickler, > pload=None, pid=None): > -------- CUT --------- > > Adding thread pool would require adding some locking. I think it > wouldn't speed up communication for typical usage (a few requests to > memcache server per controller action). Correct me, if I'm wrong. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

