Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.33 KB | None | 0 0
  1. let outbound = async_stream::stream! {
  2.     for _ in 0..10 {
  3.         let hello = String::from("hello");
  4.         let bytes = hello.as_bytes();
  5.         yield Bytes { bytes: bytes.to_vec() };
  6.         time::delay_for(Duration::from_secs(1)).await;
  7.     }
  8. };
  9.  
  10. let response = client.connect_to_server(Request::new(outbound)).await?;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement