EVECelery.clients.ClientRedis#

Module Contents#

Classes#

ConfigRedis

ClientRedis

Wrapper around Redis client that configures connection parameters from OS env variables.

ClientRedisResultBackend

The result backend client for Celery

ClientRedisLocks

The redis connection for cache by tasks.

ClientRedisCache

The redis connection for cache by tasks.

class EVECelery.clients.ClientRedis.ConfigRedis#

Bases: pydantic.BaseModel

user: str#
password: str#
host: str#
port: int#
db: int#
valid_db_number(v)#
class EVECelery.clients.ClientRedis.ClientRedis(user: str, password: str, host: str, port: int, db: int)#

Bases: EVECelery.clients.BaseClient.BaseClient

Wrapper around Redis client that configures connection parameters from OS env variables.

Parameters:
  • user (str) – Redis user

  • password (str) – Redis password

  • host (str) – Redis hostname

  • port (int) – Redis port - normally 6379

  • db (int) – Redis DB - namespace for all queues

property redis: redis.Redis#
Return type:

redis.Redis

property connection_str#

Returns the connection string for use by Celery

check_connection() bool#

Check that a connection is successful, else raise exception

Return type:

bool

class EVECelery.clients.ClientRedis.ClientRedisResultBackend(user: str | None = None, password: str | None = None, host: str | None = None, port: int | None = None, db: int | None = None)#

Bases: ClientRedis

The result backend client for Celery

Parameters:
  • user (Optional[str]) –

  • password (Optional[str]) –

  • host (Optional[str]) –

  • port (Optional[int]) –

  • db (Optional[int]) –

class EVECelery.clients.ClientRedis.ClientRedisLocks(user: str | None = None, password: str | None = None, host: str | None = None, port: int | None = None, db: int | None = None)#

Bases: ClientRedis

The redis connection for cache by tasks.

If env variables are not explicitly configured for this client it will use the same database as the result backend.

Parameters:
  • user (Optional[str]) –

  • password (Optional[str]) –

  • host (Optional[str]) –

  • port (Optional[int]) –

  • db (Optional[int]) –

class EVECelery.clients.ClientRedis.ClientRedisCache(user: str | None = None, password: str | None = None, host: str | None = None, port: int | None = None, db: int | None = None)#

Bases: ClientRedis

The redis connection for cache by tasks.

If env variables are not explicitly configured for this client it will use the same database as the result backend.

Parameters:
  • user (Optional[str]) –

  • password (Optional[str]) –

  • host (Optional[str]) –

  • port (Optional[int]) –

  • db (Optional[int]) –