MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / reserve_turn

Function reserve_turn

libatomic/src/daemon/provenance_core.rs:109–118  ·  view source on GitHub ↗

Reserve or retrieve the stable identity for a session turn. The first reserve claims the turn; a committed reservation returns only after the store's transaction commits.

(
    store: &RedbChangeStore,
    session_id: &str,
    turn_number: u32,
    now: i64,
)

Source from the content-addressed store, hash-verified

107/// reserve claims the turn; a committed reservation returns only after the
108/// store's transaction commits.
109pub fn reserve_turn(
110 store: &RedbChangeStore,
111 session_id: &str,
112 turn_number: u32,
113 now: i64,
114) -> Result<StoredProvenanceTurn, JournalError> {
115 store
116 .reserve_provenance_turn(session_id, turn_number, now)
117 .map_err(|error| JournalError::store(ErrorCode::ProvenanceStore, error))
118}
119
120/// Append one durable envelope batch with generation fencing. Duplicate
121/// event IDs re-acknowledge their original sequences; a committed batch

Callers 1

reserve_turn_implFunction · 0.85

Calls 2

storeFunction · 0.85

Tested by

no test coverage detected