]> piware.de Git - learn-rust.git/commit
async-http: Serve requests concurrently
authorMartin Pitt <martin@piware.de>
Fri, 16 Sep 2022 06:47:48 +0000 (08:47 +0200)
committerMartin Pitt <martin@piware.de>
Fri, 16 Sep 2022 06:58:56 +0000 (08:58 +0200)
commit2a3abc5cfab55a80f35438d195a2151478aa4f93
tree889a3f471608c26e155c3a90330cb35d13b2740a
parent5ae5a42b2644afab404f99b01503d6dd7d6a01b1
async-http: Serve requests concurrently

Move to asyncstd TCPListener and futures Stream, so that the incoming
loop does not serialize/block requests any more.

This is still single-threaded. That can be demonstrated with replacing
the async sleep with a sync one (commented out). Then /sleep will block
other requests again.
async-http/Cargo.toml
async-http/src/main.rs