Question

Is there a python memcache client that is gevent-friendly AND supports user/pass authentication?

A similar question was asked: Gevent ready memcache client?

That person wanted a gevent-friendly memcache client and didn't care specifically about authentication. The proposed solutions are ultramemcache and the wrapper python-ultramemcached.

Indeed, python-ultramemcached appears to be gevent-friendly (I ran a test to verify) but as far as I can tell, it doesn't support authentication. The docs for python-ultramemcached indicate that it works like python-memcached.

From https://github.com/linsomniac/python-memcached/blob/master/memcache.py

class Client(local):

    def __init__(self, servers, debug=0, pickleProtocol=0,
                 pickler=pickle.Pickler, unpickler=pickle.Unpickler,
                 pload=None, pid=None,
                 server_max_key_length=None, server_max_value_length=None,
                 dead_retry=_DEAD_RETRY, socket_timeout=_SOCKET_TIMEOUT,
                 cache_cas = False, flush_on_reconnect=0, check_keys=True):

The constructor doesn't take username/password arguments.

For now I'm using pylibmc, and it does support auth:

mc = pylibmc.Client(my_servers, username=my_username, password=my_password, binary=True)

However, it doesn't yield control to gevent. Every memcache call is synchronous.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top