pub fn recv_from_stdin(buffer_size: usize) -> Receiver<String>
Expand description

Returns a [mpsc::Receiver] that contains the input from stdin

This is accomplished by spawning a thread which continuously blocks on reading from stdin and sends input via [mpsc::Sender]

Examples

use async_stdin::recv_from_stdin;

#[tokio::main]
async fn main() {
   let mut rx = recv_from_stdin(10);
   while let Some(s) = rx.recv().await {
      println!("Received: {}", s);
  }
}