Function vector::test_util::spawn_collect_n

source ยท
pub async fn spawn_collect_n<F, S>(future: F, stream: S, n: usize) -> Vec<Event>
where F: Future<Output = ()> + Send + 'static, S: Stream<Item = Event>,
Expand description

Collect the first n events from a stream while a future is spawned in the background. This is used for tests where the collect has to happen concurrent with the sending process (ie the stream is handling finalization, which is required for the future to receive an acknowledgement).