Skip to main content

OperationStore

Trait OperationStore 

Source
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§

Source

fn admit(&self, operation_id: OperationId)

Record that we’re starting to process this operation.

Source

fn lookup(&self, operation_id: OperationId) -> OperationState

Check the state of an operation.

Source

fn get_sealed(&self, operation_id: OperationId) -> Option<SealedResponse>

Retrieve a sealed response.

Source

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.

Source

fn remove(&self, operation_id: OperationId)

Remove an admitted (but not sealed) operation, e.g. after handler failure.

Implementors§