b3b8010e1c6eadc2769103e13f1c1d8cca521a5b
The current implementation of `drain` uses a `tokio::sync::watch` channel to send the shutdown signal, and a `tokio::sync::mpsc` to signal when all draining tasks have completed. No data is ever actually sent on the MPSC; instead, it is simply used to notify the task that signalled the drain when all draining tasks have been dropped. Tokio 0.3's `watch::Sender` has a `closed` method that can be used to await the dropping of all receivers. This can be used instead of the MPSC channel. This commit updates `drain` to use `watch::Sender::closed` instead. This has fewer moving parts, and may have slightly less overhead (as it doesn't require additional allocation forthe MPSC which is never actually used). Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hyper
A fast and correct HTTP implementation for Rust.
- HTTP/1 and HTTP/2
- Asynchronous design
- Leading in performance
- Tested and correct
- Extensive production use
- Client and Server APIs
Get started by looking over the guides.
"Low-level"
hyper is a relatively low-level library, meant to be a building block for libraries and applications.
If you are looking for a convenient HTTP client, then you may wish to consider reqwest. If you are looking for a convenient HTTP server, then you may wish to consider warp. Both are built on top of this library.
Contributing
To get involved, take a look at CONTRIBUTING.
If you prefer chatting, there is an active community in the Discord server.
License
hyper is provided under the MIT license. See LICENSE.
Languages
Rust
94.5%
C
5.2%
Shell
0.3%