Skip to main content

collect_data_events_until_response

Function collect_data_events_until_response 

Source
pub async fn collect_data_events_until_response(
    rx: &mut UnboundedReceiver<DataEvent>,
    request_id: UUID4,
    timeout: Duration,
) -> Vec<DataEvent>
Expand description

Collects the data events received on rx up to and including the response correlated with request_id, then drains any further events available without waiting.

timeout bounds only the wait through the correlated response, so a passing run returns when that response arrives instead of waiting out the window.

ยงPanics

Panics if the channel closes before the correlated response arrives, or if that response does not arrive within timeout.