backends.consul

Consul result store backend.

  • ConsulBackend implements KeyValueStoreBackend to store results
    in the key-value store of Consul.

Module Contents

Classes

ConsulBackend(self,*args,**kwargs) Consul.io K/V store backend for Celery.
class ConsulBackend(*args, **kwargs)

Consul.io K/V store backend for Celery.

__init__(*args, **kwargs)
_init_from_params(hostname, port, virtual_host, **params)
_key_to_consul_key(key)
get(key)
mget(keys)
set(key, value)

Set a key in Consul.

Before creating the key it will create a session inside Consul where it creates a session with a TTL

The key created afterwards will reference to the session’s ID.

If the session expires it will remove the key so that results can auto expire from the K/V store

delete(key)