Skip to main content

send_bounded

Function send_bounded 

Source
async fn send_bounded<T>(
    response_sender: &Sender<Result<T, Status>>,
    item: Result<T, Status>,
) -> bool
Expand description

Sends item to a response stream, returning false if the client disconnected or stopped reading.

The send is bounded by STREAM_SEND_TIMEOUT so a client that holds its connection open without consuming the stream can’t park the producer task, and its buffered responses, for the lifetime of the process.