detect_stall

Function until_stalled

Source
pub fn until_stalled<RS: RequestStream>(
    request_stream: RS,
    debounce_interval: MonotonicDuration,
) -> (impl StreamAndControlHandle<RS, <RS as Stream>::Item>, Receiver<Option<Channel>>)
Expand description

until_stalled wraps a FIDL request stream of type [RS] into another stream yielding the same requests, but could complete prematurely if it has stalled, meaning:

  • The underlying request_stream has no new messages.
  • There are no pending FIDL replies.
  • This condition has lasted for at least debounce_interval.

When that happens, the request stream will complete, and the returned future will complete with the server endpoint which has been unbound from the stream. The returned future will also complete if the request stream ended on its own without stalling.