MemoryStorageClient
Hierarchy
- BaseStorageClient
- MemoryStorageClient
Index
Methods
__init__
A default constructor.
Parameters
optionalkeyword-onlyconfiguration: Configuration | None = None
Configuration object to use. If None, a default instance will be created.
Returns None
add_resource_client_to_cache
Add a new resource client to the internal cache.
Parameters
optionalkeyword-onlyresource_client: ResourceClient
Returns None
dataset
Gets a subclient for a specific dataset by its ID.
Parameters
optionalkeyword-onlyid: str
Returns BaseDatasetClient
datasets
Gets a subclient for dataset collection operations.
Returns BaseDatasetCollectionClient
get_cached_resource_client
Try to return a resource client from the internal cache.
Parameters
optionalkeyword-onlyresource_client_class: type[TResourceClient]
optionalkeyword-onlyid: str | None
optionalkeyword-onlyname: str | None
Returns TResourceClient | None
key_value_store
Gets a subclient for a specific key-value store by its ID.
Parameters
optionalkeyword-onlyid: str
Returns BaseKeyValueStoreClient
key_value_stores
Gets a subclient for key-value store collection operations.
Returns BaseKeyValueStoreCollectionClient
purge_on_start
Performs a purge of the default storages.
This method ensures that the purge is executed only once during the lifetime of the instance. It is primarily used to clean up residual data from previous runs to maintain a clean state. If the storage client does not support purging, leave it empty.
Returns None
request_queue
Gets a subclient for a specific request queue by its ID.
Parameters
optionalkeyword-onlyid: str
Returns BaseRequestQueueClient
request_queues
Gets a subclient for request queue collection operations.
Returns BaseRequestQueueCollectionClient
Properties
datasets_directory
Path to the directory containing datasets.
key_value_stores_directory
Path to the directory containing key-value stores.
persist_storage
Whether to persist the storage.
request_queues_directory
Path to the directory containing request queues.
storage_dir
Path to the storage directory.
write_metadata
Whether to write metadata to the storage.
Represents an in-memory storage client for managing datasets, key-value stores, and request queues.
It emulates in-memory storage similar to the Apify platform, supporting both in-memory and local file system-based persistence.
The behavior of the storage, such as data persistence and metadata writing, can be customized via initialization parameters or environment variables.