pub trait OperationStore:
MaybeSend
+ MaybeSync
+ 'static {
// Required methods
fn admit(&self, operation_id: OperationId);
fn lookup(&self, operation_id: OperationId) -> OperationState;
fn get_sealed(&self, operation_id: OperationId) -> Option<SealedResponse>;
fn seal(
&self,
operation_id: OperationId,
method_id: MethodId,
response: &PostcardPayload,
);
fn remove(&self, operation_id: OperationId);
}Expand description
Operation state backing for exactly-once delivery across session resumption within a single process.
The default implementation is in-memory. Schemas are NOT stored —
they come from the running code on replay. Cross-process /
cross-version durability is the responsibility of persist methods,
which would require a separate store implementation that grapples
with schema migration; that contract is out of scope here.
Required Methods§
Sourcefn admit(&self, operation_id: OperationId)
fn admit(&self, operation_id: OperationId)
Record that we’re starting to process this operation.
Sourcefn lookup(&self, operation_id: OperationId) -> OperationState
fn lookup(&self, operation_id: OperationId) -> OperationState
Check the state of an operation.
Sourcefn get_sealed(&self, operation_id: OperationId) -> Option<SealedResponse>
fn get_sealed(&self, operation_id: OperationId) -> Option<SealedResponse>
Retrieve a sealed response.
Sourcefn seal(
&self,
operation_id: OperationId,
method_id: MethodId,
response: &PostcardPayload,
)
fn seal( &self, operation_id: OperationId, method_id: MethodId, response: &PostcardPayload, )
Store the sealed response for an operation. response is the
postcard-encoded payload without schemas; method_id is needed
at replay time to look up the response shape from the running
code.
Sourcefn remove(&self, operation_id: OperationId)
fn remove(&self, operation_id: OperationId)
Remove an admitted (but not sealed) operation, e.g. after handler failure.