Continuum.Runtime.Engine (continuum v0.5.0)

Copy Markdown View Source

GenServer-per-run. The heart of replay.

Each run is owned by exactly one Engine GenServer process; the process is started by start_run/3 under Continuum.Runtime.RunSupervisor.

The same replay loop runs against both the in-memory journal and the Postgres journal. Postgres durability, scheduling, and fencing are provided by the journal adapter and runtime pollers around this engine.

Summary

Functions

Block the caller until the run completes (or timeout ms elapses).

Cancel a running workflow.

Start a fresh workflow run.

Functions

await(run_id, timeout, opts \\ [])

Block the caller until the run completes (or timeout ms elapses).

Polls the journal at 5 ms intervals. Source of truth is the journal — works even after the engine process has exited.

Accepts journal: in opts to override which journal adapter to poll.

broadcast_run_finished(instance, run_id, state, payload)

cancel(run_id, opts \\ [])

Cancel a running workflow.

start_run(workflow_module, input, opts \\ [])

Start a fresh workflow run.

wake(instance, run_id)