awak 0.2.36

A small async runtime for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io;
use std::time::Duration;

use awak::net::UnixStream;
use awak::time::delay_for;
use futures_util::AsyncReadExt;

fn main() -> io::Result<()> {
    awak::block_on(async {
        let mut stream = UnixStream::connect("temp.sock").await?;
        loop {
            let mut buf = vec![0; 10];
            stream.read_exact(&mut buf).await?;
            println!("read bytes: {:?}", buf);
            delay_for(Duration::from_secs(1)).await;
        }
    })
}