A streaming step's filter: the module a call/3 plugin declared with
use Alternera.Plugin, streams: true names when its call/3 answers
{:stream, first, {module, state}, writes}.
The proxy feeds the step's own body through it, piece by piece, whether
the body streams or is held (Plugin.CallAdapter): when the walk holds,
the adapter feeds the held body in the same pieces and joins what comes
out. So the step has one code path; a setting that cannot stream does its
work in finish/1, on what chunk/2 gathered.
chunk(bytes, state): one piece of the decoded body;{:ok, out, state},outthe iodata that goes on.finish(state): after the last piece;{:ok, last, summary}, or{:skip, last, reason}when the step took no part: the body went on as it came (lastis what the filter still held of it), and the step is recorded as skipped, as it would be held.abort(reason, state)(optional): the stream ended early (a filter failed, the client went, the upstream broke off;reasonsays which), so the filter frees what it holds. At most once, and never after afinish/1that answered:okor a skip.
chunk/2 and finish/1 may answer {:error, type, message};
malformed_body blames the body. Streamed, what went out cannot be taken
back and the step fails; held, nothing went out, so the step skips and
the body goes on as it came.