Jido.Composer.Children (Jido Composer v0.6.0)

Copy Markdown View Source

Typed sub-state for tracking child agent references and their lifecycle phases.

Replaces the flat children: %{} + child_phases: %{} maps that were previously stored directly in both Workflow and Orchestrator strategy state.

Summary

Functions

Get the ChildRef for a given tag.

Merge multiple phase entries at once.

Returns all ChildRefs with status :paused.

Record that a child process exited.

Record that a child has hibernated (checkpoint).

Record that a child produced a result (child_result signal).

Register a child that has started (child_started signal).

Set the phase for a child tag.

Returns tags of children in :spawning phase.

Types

t()

@type t() :: %Jido.Composer.Children{
  phases: %{required(term()) => :spawning | :awaiting_result},
  refs: %{required(term()) => Jido.Composer.ChildRef.t()}
}

Functions

get_ref(children, tag)

@spec get_ref(t(), term()) :: Jido.Composer.ChildRef.t() | nil

Get the ChildRef for a given tag.

merge_phases(children, phase_map)

@spec merge_phases(t(), %{required(term()) => :spawning | :awaiting_result}) :: t()

Merge multiple phase entries at once.

new()

@spec new() :: t()

paused_refs(children)

@spec paused_refs(t()) :: [{term(), Jido.Composer.ChildRef.t()}]

Returns all ChildRefs with status :paused.

record_exit(children, tag, reason)

@spec record_exit(t(), term(), term()) :: t()

Record that a child process exited.

record_hibernation(children, tag, checkpoint_key, suspension_id)

@spec record_hibernation(t(), term(), term(), String.t() | nil) :: t()

Record that a child has hibernated (checkpoint).

record_result(children, tag)

@spec record_result(t(), term()) :: t()

Record that a child produced a result (child_result signal).

register_started(children, tag, child_ref_params)

@spec register_started(t(), term(), keyword()) :: t()

Register a child that has started (child_started signal).

set_phase(children, tag, phase)

@spec set_phase(t(), term(), :spawning | :awaiting_result) :: t()

Set the phase for a child tag.

spawning_tags(children)

@spec spawning_tags(t()) :: [term()]

Returns tags of children in :spawning phase.