Documentation
¶
Overview ¶
Package arrivals records when the relay received events that were already old on arrival, so retention can age them from receipt instead of from their created_at (event_purge.retention_clock: received).
Only late arrivals are recorded. An event received within the late-arrival threshold of its created_at is aged from created_at, which is at most that much early, so the ledger holds the late arrivals of one keep window rather than every event. It persists as an append-only file of "<event id> <unix seconds>" lines: Flush appends what was recorded since the last flush, and Prune rewrites the file without expired entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger maps event ids to the unix time they arrived. Safe for concurrent use.
func Open ¶
Open loads the ledger at path. A missing file is an empty ledger; malformed lines are skipped.
func (*Ledger) Flush ¶
Flush appends the arrivals recorded since the last write. On failure they stay queued for the next attempt.