feat: tokio stream
This commit is contained in:
10
__concurrent/async_study/examples/tokio_stream.rs
Normal file
10
__concurrent/async_study/examples/tokio_stream.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use tokio_stream::{self as stream, StreamExt};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let mut stream = stream::iter(vec![0, 1, 2]);
|
||||
|
||||
while let Some(value) = stream.next().await {
|
||||
println!("Got {}", value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user