Crate steno

Source
Expand description

Steno is an in-progress prototype implementation of distributed sagas. Sagas orchestrate the execution of a set of asynchronous tasks that can fail. The saga pattern provides useful semantics for unwinding the whole operation when any task fails. For more on distributed sagas, see this 2017 JOTB talk by Caitie McCaffrey.

§Overview

This crate is necessarily somewhat complex to use. For a detailed, documented example, see examples/trip.rs.

Structs§

ActionContext
Action’s handle to the saga subsystem
ActionFunc
Implementation of Action that uses ordinary functions for the action and undo action
ActionName
Unique name for a saga Action
ActionRegistry
A registry of saga actions that can be used across multiple sagas.
Dag
Describes a directed acyclic graph (DAG) to be used as a saga or subsaga
DagBuilder
Used to build a Dag that can then be executed as either a saga or subsaga
DagBuilderError
InMemorySecStore
Implementation of SecStore that doesn’t store any state persistently
Node
Describes a node in the saga DAG
NodeName
Unique name for a saga Node
RepeatInjected
Arguments which can be passed to the SEC instructing it to change the number of times a node is executed.
SagaCreateParams
Describes what an impl of SecStore needs to store for a persistent saga record.
SagaDag
A Dag plus saga input parameters that together can be used to execute a saga
SagaExecStatus
Summarizes in-progress execution state of a saga
SagaId
Unique identifier for a Saga (an execution of a saga template)
SagaLog
Write to a saga’s log
SagaName
Human-readable name for a particular saga
SagaNodeEvent
An entry in the saga log
SagaNodeId
Unique identifier for a saga node
SagaResult
Summarizes the final state of a saga execution
SagaResultErr
Provides access to failure details for a saga that failed
SagaResultOk
Provides access to outputs from a saga that completed successfully
SagaSerialized
Simple file-based serialization and deserialization of a whole saga, intended only for testing and debugging
SagaView
External consumer’s view of a saga
SecClient
Client handle for a Saga Execution Coordinator (SEC)
SecExecClient
Handle used by SagaExecutor for sending messages back to the SEC

Enums§

ActionError
An error produced by a saga action
ActionRegistryError
An error returned from ActionRegistry::get()
SagaCachedState
Describes the cacheable state of the saga
SagaNodeEventType
Event types that may be found in the log for a particular action
SagaStateView
State-specific parts of a consumer’s view of a saga
UndoActionError
An error produced by a failed undo action

Traits§

Action
Building blocks of sagas
ActionData
Data produced by the consumer that may need to be serialized to the saga log
SagaType
Collection of consumer-provided types, effectively defining the type signature of a saga
SecStore
Interfaces implemented by the Steno consumer to storing saga state and saga log state persistently

Functions§

new_action_noop_undo
Given a function f, return an ActionFunc that uses f as the action and provides a no-op undo function (which does nothing and always succeeds).
sec
Creates a new Saga Execution Coordinator

Type Aliases§

ActionFuncResult
Result of a function that implements a saga action
ActionResult
Result of a saga action
UndoResult
Result of a saga undo action