pynenc.util.redis_keys#

Module Contents#

Classes#

Key

Helper class to manage Redis key formats for various components.

Functions#

sanitize_for_redis

Sanitizes a string for use as a Redis key.

API#

pynenc.util.redis_keys.sanitize_for_redis(s: str) str[source]#

Sanitizes a string for use as a Redis key.

Parameters:

s (str) – The string to sanitize.

Returns:

The sanitized string.

class pynenc.util.redis_keys.Key(app_id: str, prefix: str)[source]#

Helper class to manage Redis key formats for various components.

Parameters:
  • app_id (str) – The application ID.

  • prefix (str) – The prefix for the keys.

Initialization

invocation(invocation_id: str) str[source]#
task(task_id: str) str[source]#
args(task_id: str, arg: str, val: str) str[source]#
status(task_id: str, status: pynenc.invocation.status.InvocationStatus) str[source]#
pending_timer(invocation_id: str) str[source]#
previous_status(invocation_id: str) str[source]#
invocation_status(invocation_id: str) str[source]#
invocation_retries(invocation_id: str) str[source]#
call(call_id: str) str[source]#
call_to_invocation(call_id: str) str[source]#
edge(call_id: str) str[source]#
waiting_for(invocation_id: str) str[source]#
waited_by(invocation_id: str) str[source]#
all_waited() str[source]#
not_waiting() str[source]#
history(invocation_id: str) str[source]#
result(invocation_id: str) str[source]#
exception(invocation_id: str) str[source]#
invocation_auto_purge() str[source]#
default_queue() str[source]#
purge(client: redis.Redis) None[source]#

Purges all keys with the given prefix in Redis.

Parameters:

client (redis.Redis) – The Redis client.