Skip to main content

Module readstate

Module readstate 

Source
Expand description

Read-state flushing — turning dirty local cursors into readState records in the user’s own PDS.

In the LIB, not the binary’s scheduler, because two callers need it. The background flusher is one. Sign-out is the other: it must flush before revoking the session, or the reads are stranded with nothing able to send them (#117). scheduler keeps the scheduling — the interval loop and the DID selection; this module owns the domain logic.

Functions§

flush_did
Flush a single DID’s dirty cursors in one batched applyWrites, then clear the dirty flag for the cursors that were included.
fnv1a_64
FNV-1a 64-bit — a tiny, dependency-free stable hash for the feed-key.
read_state_rkey
Derive the deterministic, stable rkey for a feed’s read-state record from its URL, so there is exactly one record per feed (a fixed key, not a fresh tid per flush).