Expand description
Where the leases of delegated tasks are kept (ADR 0020).
A lease is granted on the replica that runs the task and renewed by a
GetTask that may land on any replica, so its deadline lives where every
replica can see it. InMemoryLeaseStore serves one process;
PostgresLeaseStore (the postgres feature) serves replicas sharing a
database.
Structs§
- InMemory
Lease Store - Leases kept in memory, shared by every handler holding a clone.
- Postgres
Lease Store - Leases in a PostgreSQL table,
a2a_leases, created if absent.
Traits§
- Lease
Store - Where leases are kept: a time to live and a deadline per task, keyed by
tenant (
""without one) and task id.
Functions§
- deadline_
lapsed - Whether a lease ending at
deadline_mshas lapsed atnow_ms: it holds through its deadline’s millisecond, so a renewal that lands on it is not too late. - now_
unix_ ms - Milliseconds since the Unix epoch, now.
Type Aliases§
- Lapsed
Leases - What
LeaseStore::lapsed_manyanswers: whether each lease that exists has lapsed, by(tenant, task).