Squidie.Runtime.Journal.Cancellation (squidie v0.1.2)

Copy Markdown View Source

Journal-backed workflow cancellation.

Cancellation appends a terminal run fact to the run thread. Dispatch projections already overlay terminal run facts from run threads, so stale claims and later completions are fenced by the same durable source of truth. The configured queue selects the returned dispatch projection; cancellation itself is scoped by the globally unique run id.

Summary

Functions

Cancels a journal-backed workflow run.

Types

cancel_error()

@type cancel_error() ::
  :not_found
  | :invalid_run_id
  | {:invalid_option, term()}
  | {:invalid_transition, atom(), :cancelling}
  | term()

Functions

cancel(run_id, opts \\ [])

@spec cancel(
  String.t(),
  keyword()
) :: {:ok, Squidie.ReadModel.Inspection.Snapshot.t()} | {:error, cancel_error()}

Cancels a journal-backed workflow run.