Skip to main content

answer_while_draining

Function answer_while_draining 

Source
fn answer_while_draining(reason: ClosureReason) -> Option<bool>
Expand description

How a close is answered for a Session whose SURB buffer is already draining.

A WriteClosed/EmptyRead is the end-of-stream our own ingress abort produces, so it is absorbed and the drain continues; anything else — a second operator close, or a peer SessionError — overrules the drain by falling through to the hard teardown.

begin_surb_drain asks it twice, because a Session can be found draining either before the transition or by losing it to a concurrent close.