Skip to main content

StorageInstanceManager

Manager for caching and managing storage instances.

This class centralizes the caching logic for all storage types (Dataset, KeyValueStore, RequestQueue) and provides a unified interface for opening and managing storage instances.

Index

Methods

__init__

  • __init__(): None
  • Returns None

clear_cache

  • clear_cache(): None
  • Clear all cached storage instances.


    Returns None

open_storage_instance

  • async open_storage_instance(*, id, name, alias, storage_client_type, client_opener_coro, additional_cache_key): T
  • Open a storage instance with caching support.


    Parameters

    • keyword-onlyid: str | None

      Storage ID.

    • keyword-onlyname: str | None

      Storage name. (global scope, persists across runs).

    • keyword-onlyalias: str | None

      Storage alias (run scope, creates unnamed storage).

    • keyword-onlystorage_client_type: type[StorageClient]

      Type of storage client to use.

    • keyword-onlyclient_opener_coro: ClientOpenerCoro

      Coroutine to open the storage client when storage instance not found in cache.

    • optionalkeyword-onlyadditional_cache_key: Hashable = ''

      Additional optional key to differentiate cache entries.

    Returns T

remove_from_cache

  • remove_from_cache(storage_instance): None
  • Remove a storage instance from the cache.


    Parameters

    • storage_instance: Storage

      The storage instance to remove.

    Returns None