]> piware.de Git - learn-rust.git/commit
async-http: Serve requests in parallel in threads
authorMartin Pitt <martin@piware.de>
Fri, 16 Sep 2022 07:03:46 +0000 (09:03 +0200)
committerMartin Pitt <martin@piware.de>
Fri, 16 Sep 2022 07:03:46 +0000 (09:03 +0200)
commitc4531591e9396d86e57f32badcd8dd05edaafbfe
tree27eeb3d323c8b400cc5655e8d8c9554d621f970f
parent2a3abc5cfab55a80f35438d195a2151478aa4f93
async-http: Serve requests in parallel in threads

Use async_std::task::spawn to launch a request in a thread.

Now even synchronous sleep does not block other requests, as long as
they don't exceed the thread pool capacity.
async-http/src/main.rs