Crates.io | safeword |
lib.rs | safeword |
version | 0.1.0 |
source | src |
created_at | 2018-08-18 03:35:39.489005 |
updated_at | 2018-08-18 03:35:39.489005 |
description | Gracefully ends a Tokio-based application upon receiving a signal |
homepage | https://github.com/ilianaw/safeword |
repository | https://github.com/ilianaw/safeword |
max_upload_size | |
id | 80022 |
size | 8,539 |
Safeword is a library for gracefully ending a Tokio-based application upon receiving a signal.
This could be useful for cleaning up after a program cleanly exits. For example, you might have a server that listens on a Unix domain socket, which does not automatically delete the socket path after the object is dropped. You can run your application with Safeword::run
instead of tokio::run
and know whether your application was asked to stop, or stopped for another reason (such as the future finishing earlier than you expected).
See the examples for how this might be usefully used.