Skip to content

Protocols

The AsyncKeyValue protocol defines the interface that all stores and wrappers must implement. This protocol-based design allows for maximum flexibility and composability.

AsyncKeyValue Protocol

AsyncKeyValue

Bases: AsyncKeyValueProtocol, Protocol

A protocol for key-value store operations.

Includes basic operations: get, put, delete, ttl Includes bulk operations: get_many, put_many, delete_many, ttl_many.

Source code in key-value/key-value-aio/src/key_value/aio/protocols/key_value.py
class AsyncKeyValue(AsyncKeyValueProtocol, Protocol):
    """A protocol for key-value store operations.

    Includes basic operations: get, put, delete, ttl
    Includes bulk operations: get_many, put_many, delete_many, ttl_many.
    """