Expand description
Task storage backend.
Modules§
- applied
- The log position a write folds, carried into the store the way the tenant
is (
TenantContext): a task-local, so no write method’s signature changes. - caller_
keys - Moving stored caller partitions to the identities of 0.15 (audit register R12).
- claim
- Turn claims: one replica at a time runs a task, however many share its store.
- encrypted
encryption - Encryption at rest for what a task carries.
- halt
- Halts that every replica sees and a restart keeps (ADR 0019).
- holds
- Holds on a task’s event log: the positions an attached stream still owes, which the log’s bound must not drop (spec §3.5.2: “Each stream MUST receive the same events in the same order”).
- lease
- Where the leases of delegated tasks are kept (ADR 0020).
- migration
sqlite - Schema versioning and migration support for
SqliteTaskStore. - pg_
migration postgres - Schema versioning and migration support for
PostgresTaskStore. - postgres_
store postgres PostgreSQL-backedTaskStoreimplementation.- retention
- Retention for the persistent task stores.
- sqlite_
store sqlite - SQLite-backed
TaskStoreimplementation. - task_
store - Task persistence trait and in-memory implementation.
- tenant
- Tenant-scoped task store implementations.
- tenant_
postgres_ store postgres - Tenant-scoped
PostgreSQL-backedTaskStoreimplementation. - tenant_
sqlite_ store sqlite - Tenant-scoped
SQLite-backedTaskStoreimplementation. - terminal
- Terminal states are final in the store, not only in the handler.
Structs§
- Applied
Position - The log position the current write folds, if any; see the module documentation.
- Claim
Lost - A turn’s write was refused because its claim on the task was taken over: another replica runs the task now. See the module documentation.
- Event
Hold - One stream’s hold on a task’s event log; see
EventHolds. - Event
Holds - The holds attached streams have on one store’s event logs, per task.
- Held
Claim - A claim the owner still holds, as a renewal reports it.
- History
Limit - The most a task’s
historykeeps: a number of messages and a number of bytes, whichever is reached first. The oldest messages go first. - Idempotency
Holder - Who holds an idempotency key, as
TaskStore::idempotency_holderreads it: the message that claimed the key and the task the claim named. - InMemory
Halt Store - Halts kept in memory, shared by every handler holding a clone: one process’s replicas in a test, or a stand-in where nothing must survive a restart.
- InMemory
Lease Store - Leases kept in memory, shared by every handler holding a clone.
- InMemory
Task Store - In-memory
TaskStorebacked by a pre-allocatedHashMapwith secondary indexes under a single [RwLock]. - InMemory
Turn Claims - Claims in process memory, for tests that run several handlers over one in-memory store. Expiry is measured on this process’s monotonic clock.
- Migration
- A single schema migration.
- Migration
Runner - Runs schema migrations against a
SQLitedatabase. - Pending
Steering - A steering message stored for the turn that holds
token, asTurnClaimStore::peek_steeringreports it. - PgMigration
- A single schema migration.
- PgMigration
Runner - Runs schema migrations against a
PostgreSQLdatabase. - Postgres
Delegation Journal - Delegation records in a PostgreSQL table,
a2a_delegations. - Postgres
Halt Store - Halts in a PostgreSQL table,
a2a_halts, created if absent. - Postgres
Lease Store - Leases in a PostgreSQL table,
a2a_leases, created if absent. - Postgres
Task Store PostgreSQL-backedTaskStore.- Purge
Report - What one call to
purge_expireddid. - Recorded
Event - One event as the log holds it: what was emitted, and where in the order.
- Retention
Policy - How long terminal tasks are kept, and how aggressively they are removed.
- Sqlite
Delegation Journal - Delegation records in a SQLite table,
a2a_delegations, created if absent. - Sqlite
Halt Store - Halts in a SQLite table,
a2a_halts, created if absent. - Sqlite
Task Store - SQLite-backed
TaskStore. - Store
Database - The database behind a task store: what its spans and its
db.client.operation.durationmeasurements say they ran against (docs/db/database-spans.md,open-telemetry/semantic-conventions@55c98cf). - Stored
Halt - A halt as a
HaltStorekeeps it. - Task
Store Config - Configuration for
InMemoryTaskStore. - Tenant
Aware InMemory Task Store - Tenant-isolated in-memory
TaskStore. - Tenant
Aware Postgres Task Store - Tenant-scoped
PostgreSQL-backedTaskStore. - Tenant
Aware Sqlite Task Store - Tenant-scoped
SQLite-backedTaskStore. - Tenant
Context - Thread-safe tenant context for scoping store operations.
- Tenant
Store Config - Configuration for
TenantAwareInMemoryTaskStore. - Terminal
State Conflict - A write the store refused because the task it names is already terminal.
Enums§
- Artifact
Delta - What changed in a task’s artifacts, for
TaskStore::save_artifact_delta. - Halt
Signal - What a pushing
HaltStoretells the handlers sharing it (ADR 0024). - Handed
- What
TurnClaimStore::hand_steeringdid with a message. - Idempotency
Claim - What happened when a store was asked to claim an idempotency key.
- LogListen
- Where the listener of a store’s log notifications gets its session
(
PostgresTaskStore::with_log_notifications). - LogWake
- Why a wait on a task’s event log ended.
Constants§
- DEFAULT_
IDEMPOTENCY_ KEY_ TTL - How long the in-memory store keeps an idempotency key by default.
- DEFAULT_
MAX_ EVENTS_ PER_ TASK - How many events one task’s log keeps when nothing else is asked for.
- DEFAULT_
MAX_ HELD_ EVENTS_ FACTOR - How many times
max_events_per_taska task’s log may hold while an attached stream still owes its oldest events, when nothing else is asked for: 8, so 4,096 events at the default bound. - DEFAULT_
MAX_ IDEMPOTENCY_ KEYS - How many idempotency keys the in-memory store holds at most by default.
- DEFAULT_
MAX_ PAGE_ SIZE - The largest page a
listcall may return, when nothing narrower is asked for. - DEFAULT_
POOL_ SIZE postgres - How many connections a PostgreSQL store’s own pool opens, unless given
another size (
new_with_pool_size). - LOG_
NOTIFY_ CHANNEL - The channel an append is announced on. The payload is the task’s key.
- TERMINAL_
STATE_ CONFLICT_ MARKER - Key in
A2aError::datamarking a write refused because the stored task is already terminal. PreferTerminalStateConflict::from_errorover matching this string.
Statics§
- BUILTIN_
PG_ MIGRATIONS - Built-in migrations for the
PostgresTaskStoreschema.
Traits§
- Halt
Store - Where halts are kept so that every replica sees them and a restart keeps them.
- Lease
Store - Where leases are kept: a time to live and a deadline per task, keyed by
tenant (
""without one) and task id. - Task
Store - Trait for persisting and retrieving
Taskobjects. - Turn
Claim Store - Where turn claims are kept. See the module documentation.
Functions§
- refuses_
write - Whether a write carrying
writtenmust be refused over a task stored instored. - terminal_
states - The states a purge is allowed to delete.
Type Aliases§
- LogWatch
- A registered interest in one task’s event log, from
TaskStore::watch_event_log.