Replicant.Supervisor (Replicant v0.1.0)

Copy Markdown View Source

The top DynamicSupervisor — one child per running pipeline (a Replicant.Pipeline supervisor). Pipelines run as :temporary children: a fail-closed halt terminates one permanently (no restart), while transient crashes are recovered inside each Pipeline's own :one_for_all strategy.

Summary

Functions

Returns a specification to start this module under a supervisor.

Fail-closed halt of a pipeline from within its own tree. Terminates the whole pipeline permanently (it is a :temporary DynamicSupervisor child → no restart). The teardown runs in an unlinked spawned process to avoid the self-termination deadlock — a child process cannot synchronously stop its own ancestor supervisor. The caller owns the distinguishing telemetry (:slot_invalidated / :sink :failed / :schema_change :halted); halt/2 performs only the teardown and returns immediately.

Start a pipeline as a :temporary child — a fail-closed halt (halt/2) must terminate it permanently, so the DynamicSupervisor must not restart it.

Terminate a running pipeline by slot name (idempotent).

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

halt(slot_name, reason)

@spec halt(String.t(), term()) :: :ok

Fail-closed halt of a pipeline from within its own tree. Terminates the whole pipeline permanently (it is a :temporary DynamicSupervisor child → no restart). The teardown runs in an unlinked spawned process to avoid the self-termination deadlock — a child process cannot synchronously stop its own ancestor supervisor. The caller owns the distinguishing telemetry (:slot_invalidated / :sink :failed / :schema_change :halted); halt/2 performs only the teardown and returns immediately.

start_link(init_arg \\ [])

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

start_pipeline(config)

Start a pipeline as a :temporary child — a fail-closed halt (halt/2) must terminate it permanently, so the DynamicSupervisor must not restart it.

stop_pipeline(slot_name)

@spec stop_pipeline(String.t()) :: :ok

Terminate a running pipeline by slot name (idempotent).