strata_client/operation
Bounded session-local tracking for opt-in correlated mutations. Hosts retain the session across socket reconnects, and explicitly retry safe operations. This module does not persist requests after browser loss.
Explicit request tracking and retry errors.
pub type Error { DuplicateRequestId RequestLimitReached UnknownRequestId UnsafeCreateRetry AlreadyCompleted StillAmbiguous WrongReceiptDocument ProtocolError(error.DecodeError) ConnectionError(strata_client.StepError)}A normal connection event or a correlated operation receipt.
pub type Event { ConnectionEvent(strata_client.Event) OperationOutcome(operation.Receipt)}Session
Section titled “Session”A bounded tracker. Terminal records remain until forget.
pub type SessionStatus
Section titled “Status”Session-local operation status.
pub type Status { Pending Observed(operation.Outcome)}Functions
Section titled “Functions”command
Section titled “command”Send a normal client command, such as Join or Leave, through this session.
pub fn command( Session, strata_client.Command) -> #(Session, String)connection
Section titled “connection”Return the connection state for presence and join inspection.
pub fn connection(Session) -> strata_client.Connectionforget
Section titled “forget”Release a terminal record. Never reuse its ID within this logical session.
pub fn forget( Session, String) -> Result(Session, Error)inbound
Section titled “inbound”Receive a correlated receipt or a legacy document/connection event.
pub fn inbound( Session, String) -> Result(#(Session, Event), Error)Create a session around a normal client connection.
pub fn new(strata_client.Connection) -> Sessionresume
Section titled “resume”Mark in-flight operations unknown and emit only resume joins. The host must
call retry explicitly; reconnect never silently retries a create.
pub fn resume(Session) -> #(Session, List(String))Retry the exact delta/delete bytes with the original request ID.
pub fn retry( Session, String) -> Result(#(Session, String), Error)status
Section titled “status”Inspect a tracked operation, including an ambiguous timeout.
pub fn status( Session, String) -> Result(Status, Error)submit
Section titled “submit”Track and encode a new immutable request. At most 1024 records are retained.
pub fn submit( Session, operation.Request) -> Result(#(Session, String), Error)timed_out
Section titled “timed_out”Mark a local response deadline as unknown, without turning it into rejection.
pub fn timed_out( Session, String) -> Result(Session, Error)