Runs a pipeline spec in the calling process, with no sockets or timers, for tests.
import Octoroom.Agent.Pipeline.Spec
alias Octoroom.Agent.Pipeline.Test
harness =
processor(MyApp.IgnoreBackchannel)
|> Test.start!()
|> Test.push([%Frames.VADUserStartedSpeaking{}, %Frames.InterimTranscription{text: "uh-huh"}])
refute Test.interrupted?(harness)Async work runs according to :async:
:inline(default) - each task runs to completion in the calling process as soon as the frame that started it is handled. Its emitted messages are delivered in order, then its result.:manual- tasks wait untilrun_tasks/1orrun_task/3, so a test can interrupt while work is in flight.
Timers never fire by themselves; use fire_timer/3.
Summary
Functions
{reason, fatal?} for each error that left the first stage, oldest first.
Fires the pending timer key of stage name.
Delivers a handle_info/2 message to stage name.
True if anything interrupted the pipeline.
Events sent with {:notify, event}, oldest first.
Frames that left the last stage, oldest first, optionally only of module.
Keys of the tasks waiting to run (:manual mode), as {stage_name, key}.
Pushes a frame (or a list of frames) into the pipeline.
True if a frame of module left the last stage.
Starts a harness and pushes frames downstream. Takes start/2's options.
Runs the waiting task key of stage name.
Runs every waiting task, including ones started by those tasks' results.
Starts a harness for spec. Options: :async (:inline or :manual), :ctx.
Like start/2, but raises on error.
The state of stage name.
True if stage name has a pending timer key.
Frames (other than errors) that left the first stage upstream, oldest first.
Types
Functions
{reason, fatal?} for each error that left the first stage, oldest first.
Fires the pending timer key of stage name.
Delivers a handle_info/2 message to stage name.
True if anything interrupted the pipeline.
Events sent with {:notify, event}, oldest first.
Frames that left the last stage, oldest first, optionally only of module.
Keys of the tasks waiting to run (:manual mode), as {stage_name, key}.
Pushes a frame (or a list of frames) into the pipeline.
True if a frame of module left the last stage.
Starts a harness and pushes frames downstream. Takes start/2's options.
Runs the waiting task key of stage name.
Runs every waiting task, including ones started by those tasks' results.
Starts a harness for spec. Options: :async (:inline or :manual), :ctx.
Like start/2, but raises on error.
The state of stage name.
True if stage name has a pending timer key.
Frames (other than errors) that left the first stage upstream, oldest first.