Continuum.Runtime.Journal.InMemory (continuum v0.6.0)

Copy Markdown View Source

In-memory journal backed by a single GenServer.

Used by tests and by Continuum.Test. Not durable — process death loses all journaled events.

Summary

Functions

Returns a specification to start this module under a supervisor.

Pop the oldest buffered payload for signal name, or return :none.

Buffer a signal in the run's in-memory mailbox.

Return the full state of all runs known to the in-memory journal.

Wipe all journals. Test helper only.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

consume_buffered_signal!(instance, run_id, name)

Pop the oldest buffered payload for signal name, or return :none.

Called by Continuum.Runtime.Effect when an await signal(name) reaches the live tail; the consumed payload is journaled as signal_received with the await's command identity.

deliver_signal!(instance, run_id, name, payload)

Buffer a signal in the run's in-memory mailbox.

Mirrors the continuum_signals semantics of the Postgres adapter: the payload is held until a live await signal(name) consumes it, so signals arriving early or out of order wait for their matching await instead of corrupting the journal tail. Returns {:error, :not_found} when the run does not exist.

dump()

Return the full state of all runs known to the in-memory journal.

reset()

Wipe all journals. Test helper only.

start_link(opts \\ [])