celery.backends.consul

Consul result store backend.

  • ConsulBackend implements KeyValueStoreBackend to store results

    in the key-value store of Consul.

class celery.backends.consul.ConsulBackend(*args, **kwargs)[源代码]

Consul.io K/V store backend for Celery.

client()[源代码]
consistency = 'consistent'
consul = None
delete(key)[源代码]
get(key)[源代码]
mget(keys)[源代码]
path = None
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

supports_autoexpire = True

If true the backend must automatically expire results. The daily backend_cleanup periodic task won't be triggered in this case.