Skip to main content

Module halt

Module halt 

Source
Expand description

Halts that every replica sees and a restart keeps (ADR 0019).

RequestHandler::halt holds in the process that called it. With a HaltStore (RequestHandlerBuilder::with_halt_store) it is also written here, every replica sharing the store reads it before admitting its first send and then on an interval, and a restarted process comes back halted. InMemoryHaltStore shares halts between handlers in one process; SqliteHaltStore (the sqlite feature) keeps them across a restart of one process; PostgresHaltStore (the postgres feature) does both across replicas.

A store may also push (HaltStore::signals, ADR 0024): the in-memory and PostgreSQL stores tell every handler sharing them the moment a halt is written or removed, and carry a cancel to the replica running the task. The poll stays behind the push, so a lost signal costs at most one interval.

Structs§

InMemoryHaltStore
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.
PostgresHaltStore
Halts in a PostgreSQL table, a2a_halts, created if absent.
SqliteHaltStore
Halts in a SQLite table, a2a_halts, created if absent.
StoredHalt
A halt as a HaltStore keeps it.

Enums§

HaltSignal
What a pushing HaltStore tells the handlers sharing it (ADR 0024).

Traits§

HaltStore
Where halts are kept so that every replica sees them and a restart keeps them.