-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi,
I had a code like this:
let (mut sender, stream) = mpsc::channel(1000);
tokio::task::spawn(async move {
while <some_condition> {
let item = ...
sender.send(item).await.unwrap();
}
});
let stream2 = pipe(Arc::new(Desync::new(0)), stream, move |_, item| {
let result = ...
futures::future::ready(result).boxed()
});
It occurred, that sometimes an item, despite being successfully sent by sender, wasn't processed at all in pipe's closure.
After rewriting the pipe to:
let (mut sender2, stream2) = mpsc::channel(1000);
tokio::task::spawn(async move {
while let Some(item) = stream.next().await {
sender2.send(item).await.unwrap();
}
});
Everything started working correctly, thus it seems like it is a bug.
Metadata
Metadata
Assignees
Labels
No labels