What sees a response body as it leaves, read-only: the module a holding
step's leave/3 names in {:observe_body, {module, state}, summary} at
its Close (Plugin.CallAdapter).
The door calls open/2 with the upstream's head as it arrived, before
the response steps changed it (its header names in their own case), then
chunk/2 for each piece the client
is sent, then exactly one of finish/2, with the trailers, on a clean
end, or abort/2, with why, on any other: a client gone, an upstream
that broke off, an exchange that ended before the door opened the body
("abandoned"). For an answer made on the request side the body is fed
whole, after open/2 with that answer's head as it reached the Close. Nothing the client gets
depends on an observer: one that raises is logged and dropped.
The end is called at most once, from whichever process ends the exchange, so an observer that holds something outside its state (a single flight, a file) gives it back in either.
Summary
Callbacks
The body did not end cleanly, for reason.
A piece of the body as the client is sent it.
The body ended cleanly; trailers are the upstream's.
The upstream's head as it arrived (or a request-side answer's at the Close), before any piece of the body.
Types
Callbacks
The body did not end cleanly, for reason.
A piece of the body as the client is sent it.
The body ended cleanly; trailers are the upstream's.
The upstream's head as it arrived (or a request-side answer's at the Close), before any piece of the body.