Jido.Messaging.Onboarding.Worker (Jido Messaging v1.0.0)

Copy Markdown View Source

Runtime process for a single onboarding flow.

The worker restores persisted flow state, applies state-machine transitions, and persists changes when the flow advances.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the current onboarding flow state from a worker.

Starts an onboarding worker registered by onboarding ID.

Applies an onboarding transition and persists the updated flow.

Returns the worker process for onboarding_id, if it is running.

Types

state()

@type state() :: %{
  instance_module: module(),
  onboarding_id: String.t(),
  flow: Jido.Messaging.Onboarding.Flow.t()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_flow(pid, timeout \\ 5000)

@spec get_flow(pid(), timeout()) ::
  {:ok, Jido.Messaging.Onboarding.Flow.t()} | {:error, term()}

Returns the current onboarding flow state from a worker.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts an onboarding worker registered by onboarding ID.

transition(pid, transition, metadata, opts \\ [], timeout \\ 5000)

Applies an onboarding transition and persists the updated flow.

whereis(instance_module, onboarding_id)

@spec whereis(module(), String.t()) :: pid() | nil

Returns the worker process for onboarding_id, if it is running.