pynenc.arg_cache.redis_arg_cache

Module Contents

Classes

RedisArgCache

Redis-based implementation of argument caching.

API

class pynenc.arg_cache.redis_arg_cache.RedisArgCache(app: pynenc.app.Pynenc)[source]

Bases: pynenc.arg_cache.base_arg_cache.BaseArgCache

Redis-based implementation of argument caching.

Stores serialized arguments in Redis for distributed access. Suitable for production use as cache is shared across all processes.

Initialization

Initialize with app reference.

property client: redis.Redis

Lazy initialization of Redis client

conf() pynenc.conf.config_arg_cache.ConfigArgCacheRedis

Get Redis-specific configuration.

_store(key: str, value: str) None[source]

Store a value in Redis.

Parameters:
  • key (str) – The cache key

  • value (str) – The serialized value to cache

_retrieve(key: str) str[source]

Retrieve a value from Redis.

Parameters:

key (str) – The cache key

Returns:

The cached serialized value

Raises:

KeyError – If key not found in cache

_purge() None[source]

Clear all cached arguments from Redis.