mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00

This change removes all references to `Stream` from within the `tokio` crate and moves them into a new `tokio-stream` crate. Most types have had their `impl Stream` removed as well in-favor of their inherent methods. Closes #2870
19 lines
344 B
Rust
19 lines
344 B
Rust
use tokio_stream as stream;
|
|
use tokio_test::task;
|
|
|
|
use std::iter;
|
|
|
|
#[tokio::test]
|
|
async fn coop() {
|
|
let mut stream = task::spawn(stream::iter(iter::repeat(1)));
|
|
|
|
for _ in 0..10_000 {
|
|
if stream.poll_next().is_pending() {
|
|
assert!(stream.is_woken());
|
|
return;
|
|
}
|
|
}
|
|
|
|
panic!("did not yield");
|
|
}
|