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

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

Enums

Traits

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

Functions

  • 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).
  • Creates a new Saga Execution Coordinator

Type Definitions