Where an unencrypted server keeps entries.
Attributes#
| Attribute | Type | Description |
|---|---|---|
first_sequence | int | None = None | |
get_id | Effect[RemoteId] | The storage's remote id, which the server sends clients in its hello. Never fails. |
Functions#
get_or_create_session_auth_binding#
get_or_create_session_auth_binding(public_key, signing_public_key) -> Effect[bytes]The signing key bound to public_key, binding the given one
on first use. The server passes only verified keys, and rejects one
that differs from the returned binding. Never fails.
| Parameter | Type | Description |
|---|---|---|
public_key | str | |
signing_public_key | bytes |
Returns Effect[bytes]
@abstractmethod
def get_or_create_session_auth_binding(
self, public_key: str, signing_public_key: bytes, /
) -> Effect[bytes]:
"""The signing key bound to ``public_key``, binding the given one
on first use. The server passes only verified keys, and rejects one
that differs from the returned binding. Never fails."""entries_after#
entries_after(store_id, oldest, batch=None) -> Effect[list[RemoteEntry]]Stored entries at or after oldest: with a batch, only
those it repeats or shares an event and primary key with.
| Parameter | Type | Description |
|---|---|---|
store_id | StoreId | |
oldest | Entry | |
batch | Sequence[Entry] | None = None |
Returns Effect[list[RemoteEntry]]
@abstractmethod
def entries_after(
self, store_id: StoreId, oldest: Entry, batch: Sequence[Entry] | None = None, /
) -> Effect[list[RemoteEntry]]:
"""Stored entries at or after ``oldest``: with a ``batch``, only
those it repeats or shares an event and primary key with."""write#
write(store_id, entries) -> Effect[list[RemoteEntry]]Appends entries to store_id, each at the next sequence,
publishes them to its changes, and gives them with their
sequences. Never fails; an entry already stored is a defect.
| Parameter | Type | Description |
|---|---|---|
store_id | StoreId | |
entries | Sequence[Entry] |
Returns Effect[list[RemoteEntry]]
@abstractmethod
def write(self, store_id: StoreId, entries: Sequence[Entry], /) -> Effect[list[RemoteEntry]]:
"""Appends ``entries`` to ``store_id``, each at the next sequence,
publishes them to its ``changes``, and gives them with their
sequences. Never fails; an entry already stored is a defect."""changes#
changes(store_id, start_sequence, compactors) -> Stream[RemoteEntry]The entries of store_id from start_sequence on, the
backlog compacted by compactors, then each new one as it is
written. Never fails.
| Parameter | Type | Description |
|---|---|---|
store_id | StoreId | |
start_sequence | int | |
compactors | Mapping[str, RegisteredCompactor] |
Returns Stream[RemoteEntry]
@abstractmethod
def changes(
self,
store_id: StoreId,
start_sequence: int,
compactors: Mapping[str, RegisteredCompactor],
/,
) -> Stream[RemoteEntry]:
"""The entries of ``store_id`` from ``start_sequence`` on, the
backlog compacted by ``compactors``, then each new one as it is
written. Never fails."""latest_sequence#
latest_sequence(store_id) -> Effect[int | None]The sequence of the last stored entry, None when there is none.
| Parameter | Type | Description |
|---|---|---|
store_id | StoreId |
Returns Effect[int | None]
@abstractmethod
def latest_sequence(self, store_id: StoreId, /) -> Effect[int | None]:
"""The sequence of the last stored entry, ``None`` when there is none."""with_transaction#
with_transaction[A, E, R](effect) -> Effect[A, E, R]Run effect in the storage's transaction, so its writes commit
together and publish in commit order.
| Parameter | Type | Description |
|---|---|---|
effect | Effect[A, E, R] |
Returns Effect[A, E, R]
def with_transaction[A, E, R](self, effect: Effect[A, E, R], /) -> Effect[A, E, R]:
"""Run ``effect`` in the storage's transaction, so its writes commit
together and publish in commit order."""
require_effect(effect, "effect")
return self._with_transaction(effect)