HTTP: add ability to return early / skip future callbacks
(This is somewhat related to #63, not sure if it's better to fold into that or keep as a separate issue)
ext_proc filter supports the notion of a processing mode override, in which an ext_proc ProcessingResponse for e.g. request headers can say: "skip future callbacks for this request", avoiding the cost of RPCs for request/response body.
For Proxy-Wasm, we might consider adding something analogous, for example a new proxy_action_t value indicating remaining non-lifecycle callbacks can be skipped, or allowing proxy_done to be called outside of proxy_on_done.
I was mentally bundling this with #63 (see: Done), but it doesn't hurt to have an explicit issue for that. Thanks!
Note that there are two related flavors of such a feature:
- Controlling future execution phases (a la mode_override, dynamic control over future events)
- Early return from the current phase (i.e. "I'm done", early return from streaming callbacks as in body processing)
In the proposal linked above, I'm not sure how EndStream and Done map to these concepts.
EndStream is a request/response modification that adds end_stream flag that potentially wasn't there and finishes request or response (e.g. forwarding only HTTP headers upstream), but doesn't prevent future callbacks.
Done prevents future callbacks for given request/response, which isn't as elaborate as ext_proc's mode_override, but perhaps that's sufficient?