PgFlow.FlowStarter.ModuleState (PgFlow v0.2.0)

Copy Markdown View Source

Registration snapshot for one flow/job module, as returned by PgFlow.FlowStarter.module_status/1 and embedded in status/0 results.

Tracks where the module is in the registration lifecycle (:status), which phase it last executed (registry, worker start, DB notify setup, notify registration), how many attempts have run, and the classified last error, if any.

Summary

Types

error_class()

@type error_class() :: :transient | :permanent

phase()

@type phase() :: :registry | :worker | :notify_db | :notify_register

status()

@type status() :: :pending | :retrying | :succeeded | :failed_permanent

t()

@type t() :: %PgFlow.FlowStarter.ModuleState{
  attempts: non_neg_integer(),
  last_error:
    nil
    | %{class: error_class(), phase: phase(), reason: term(), at: DateTime.t()},
  module: module(),
  status: status(),
  type: String.t(),
  updated_at: DateTime.t()
}