◐ Shell
reader mode source ↗
Skip to main content
Version: 1.7
On this page

MemoryStorageClient

Memory implementation of the storage client.

This storage client provides access to datasets, key-value stores, and request queues that store all data in memory using Python data structures (lists and dictionaries). No data is persisted between process runs, meaning all stored data is lost when the program terminates.

The memory implementation provides fast access to data but is limited by available memory and does not support data sharing across different processes. All storage operations happen entirely in memory with no disk operations.

The memory storage client is useful for testing and development environments, or short-lived crawler operations where persistence is not required.

Hierarchy

Index

Methods

create_dataset_client

  • async create_dataset_client(*, id, name, alias, configuration): DatasetClient
  • Create a dataset client.


    Parameters

    • optionalkeyword-onlyid: str | None = None
    • optionalkeyword-onlyname: str | None = None
    • optionalkeyword-onlyalias: str | None = None
    • optionalkeyword-onlyconfiguration: Configuration | None = None

    Returns DatasetClient

create_kvs_client

  • Create a key-value store client.


    Parameters

    • optionalkeyword-onlyid: str | None = None
    • optionalkeyword-onlyname: str | None = None
    • optionalkeyword-onlyalias: str | None = None
    • optionalkeyword-onlyconfiguration: Configuration | None = None

    Returns KeyValueStoreClient

create_rq_client

  • Create a request queue client.


    Parameters

    • optionalkeyword-onlyid: str | None = None
    • optionalkeyword-onlyname: str | None = None
    • optionalkeyword-onlyalias: str | None = None
    • optionalkeyword-onlyconfiguration: Configuration | None = None

    Returns RequestQueueClient

get_rate_limit_errors

  • get_rate_limit_errors(): dict[int, int]
  • Return statistics about rate limit errors encountered by the HTTP client in storage client.


    Returns dict[int, int]

get_storage_client_cache_key

  • get_storage_client_cache_key(configuration): Hashable
  • Return a cache key that can differentiate between different storages of this and other clients.

    Can be based on configuration or on the client itself. By default, returns a module and name of the client class.


    Parameters

    Returns Hashable