Spawning Communicating with tasks Multi threaded When to spawn tasks Processing inbound sockets Background processing Coordinating access to a resource When not to spawn tas...
Streams Streams A stream is an asynchronous series of values. It is the asynchronous equivalent to Rust’s std::iter::Iterator and is represented by the Stream trait. Stream...
AsyncRead and AsyncWrite async fn read() async fn read_to_end() async fn write() async fn write_all() AsyncRead and AsyncWrite These two traits provide the faciliti...
I/O Overview An example server I/O Overview The Rust standard library provides support for networking and I/O, suchas TCP connections, UDP sockets, reading from and writing...
Example: An Echo Server Setup Handling the connections Example: An Echo Server We’re going to use what has been covered so far to build an echo server. This is aTokio appl...
Concurrency Tasks 'static bound Send bound Concurrency Our server has a slight problem (besides only responding with errors). It processes inbound requests one at a time. ...
Initialize the HashMap On using std::sync::Mutex Initialize the HashMap The HashMap will be shared across many tasks and potentially many threads. To support this, it is w...
Reading and Writing Data Non-blocking I/O Working with I/O futures Split I/O resources Transports Reading and Writing Data Non-blocking I/O In the overview we mention...
Syntax Syntax The select! macro can handle more than two branches. The current limit is 64 branches. Each branch is structured as: <pattern> = <async expression > => <h...