Hourglass.WorkflowEvaluator.DynamicSupervisor (hourglass v0.1.0)

Copy Markdown View Source

Application-level shared DynamicSupervisor for per-activation Hourglass.Worker.WorkflowEvaluator Tasks.

Started once under Hourglass.Application; one instance for the whole VM (registered as __MODULE__). Promoted from a per-Worker DynSup to a shared one because evaluator Tasks have no per-task-queue state — the only per-queue thing they touch is the WorkflowStateCache, which is keyed by (task_queue, run_id) and is itself app-level.

In-flight evaluator Tasks living under this DynSup survive Worker child crashes (Workers no longer parent the DynSup). If the BridgeHolder restarts mid-evaluation the in-flight Tasks see {:error, :worker_not_registered} from complete_workflow_activation/2, exit, and Core redelivers the activation.

restart: :temporary — exited evaluators are not restarted by the supervisor. If an evaluator crashed before shipping a completion, Core redelivers the same activation as a new poll result.

Summary

Functions

Returns a specification to start this module under a supervisor.

Start a fresh WorkflowEvaluator Task under the shared DynSup. args is the evaluator args map documented on WorkflowEvaluator.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_child(args)

Start a fresh WorkflowEvaluator Task under the shared DynSup. args is the evaluator args map documented on WorkflowEvaluator.

start_link(opts \\ [])

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