rust-http2
rust-http2 copied to clipboard
Cancel calls
trafficstars
Need to have an API to cancel calls by client.
When call is cancelled, RST_STREAM is sent.
Client needs an API to cancel calls, and server needs an API to be notified of cancelled call.
One idea is that start_request should have additional Context param:
fn start_request(&self, context: Context, headers: Headers, req: HttpPartStream)
-> Response;
struct Context(...);
impl Context {
fn new() -> Context { ... }
// for client
fn cancel(&self) { ... }
// for the server to subscribe for cancel
fn wait_cancel(&self) -> HttpFutureSend<()> { ... }
}