Provisional: added for Script, and a change to it needs a changelog line but
no new major (docs/USER_PLUGINS_DESIGN.md). The namespace has nothing to do
with the context's :provisional? key.
A step calling a pipeline of its tenant while it runs. start/1 gives a
handle, or nil where the runner offers none (a Call or For each step, a test,
a preview). call/3 runs a pipeline on the exchange as the step got it plus
what earlier calls wrote, and gives a new handle. finish/2 puts the last
handle on the step's extras, and the runner goes on from the exchange the
calls left, with their outcomes nested under the step.
call/3 must run in the process that runs the step: a plugin that does its
work in a process of its own relays the call back, as Plugins.Script.Sandbox
does. A call's time is capped at time_left_ms, and a failure the step does
not handle should fail the step with the type call/3 gave.
The handle is opaque.
Summary
Types
The exchange after a call: :view, the context's view; :current, the phase's
message or body as the callee left it; :result, the callee's result or nil;
and in a body phase :content_type.
A pipeline's id or name, with the inputs of the call.
Functions
Calls a pipeline: {{:ok, reply}, handle} or {{:error, type, message}, handle}.
extras with what the calls left, for the step's result.
A handle for the step context belongs to, or nil.
Types
@opaque handle()
@type reply() :: %{ :view => map(), :current => term(), :result => term(), optional(:content_type) => String.t() | nil }
The exchange after a call: :view, the context's view; :current, the phase's
message or body as the callee left it; :result, the callee's result or nil;
and in a body phase :content_type.
A pipeline's id or name, with the inputs of the call.