pynenc_mongo.client_data_store.mongo_client_data_store

Module Contents

Classes

ArgCacheCollections

MongoDB collections for the argument cache system.

MongoClientDataStore

A MongoDB-based implementation of the argument cache for cross-process coordination.

Data

API

pynenc_mongo.client_data_store.mongo_client_data_store.logger

‘getLogger(…)’

class pynenc_mongo.client_data_store.mongo_client_data_store.ArgCacheCollections(conf: pynenc_mongo.conf.config_mongo.ConfigMongo, app_id: str)[source]

Bases: pynenc_mongo.util.mongo_collections.MongoCollections

MongoDB collections for the argument cache system.

Initialization

arg_cache() pynenc_mongo.util.mongo_client.RetryableCollection
arg_cache_chunks() pynenc_mongo.util.mongo_client.RetryableCollection

Collection for storing chunked arg cache values that exceed BSON limits.

class pynenc_mongo.client_data_store.mongo_client_data_store.MongoClientDataStore(app: pynenc.app.Pynenc)[source]

Bases: pynenc.client_data_store.base_client_data_store.BaseClientDataStore

A MongoDB-based implementation of the argument cache for cross-process coordination.

Uses MongoDB for cross-process argument caching and implements all required abstract methods from BaseClientDataStore. Large values exceeding the chunk threshold are compressed and stored across multiple documents in a dedicated chunks collection to avoid BSON size limits.

Initialization

Initialize with app reference.

Parameters:

app (Pynenc) – The Pynenc application instance

conf() pynenc_mongo.conf.config_client_data_store.ConfigClientDataStoreMongo
_store(key: str, value: str) None[source]

Store a key value pair in the cache.

Large values exceeding the chunk threshold are compressed and stored across multiple documents to avoid BSON size limits.

Parameters:
  • key – The cache key

  • value – The string value to cache

_retrieve(key: str) str[source]

Retrieve a serialized value from the cache by its key.

Parameters:

key – The cache key

Returns:

The cached serialized value

Raises:

KeyError – If the key is not found

_purge() None[source]

Clear all cached data including chunked storage.