4 stable releases
Uses old Rust 2015
2.0.0 | Mar 8, 2019 |
---|---|
1.1.1 | Nov 29, 2018 |
1.1.0 | Oct 12, 2018 |
1.0.0 | Oct 10, 2018 |
#6 in #controlled
20KB
423 lines
tokio-evacuate
A future for coordinating controlled shutdown of participants.
lib.rs
:
tokio-evacuate
provides a way to safely "evacuate" users of a resource before forcefully
removing them.
In many networked applications, there comes a time when the server must shutdown or reload, and may still be actively serving traffic. Listeners or publishers can be shut down, and remaining work can be processed while no new work is allowed.. but this may take longer than the operator is comfortable with.
Evacuate
is a middleware future, that works in conjuction with a classic "shutdown signal."
By combining a way to track the number of current users, as well as a way to fire a global
timeout, we allow applications to provide soft shutdown capabilities, giving work a chance to
complete, before forcefully stopping computation.
tokio-evacuate
depends on Tokio facilities, and so will not work on other futures executors.
Dependencies
~2MB
~35K SLoC