Crate tokio_evacuate
source ·Expand description
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.