Crates.io | chex |
lib.rs | chex |
version | 0.1.1 |
source | src |
created_at | 2024-08-14 22:34:20.603049 |
updated_at | 2024-08-14 22:42:18.417924 |
description | Global exit signal library |
homepage | |
repository | https://github.com/mbanack/chex-rs |
max_upload_size | |
id | 1338071 |
size | 27,576 |
Chex is a simple rust library which provides a global exit signal which can be easily shared between any/all threads and async tasks in a program.
This allows you to set clear policy in your program of which conditions should teardown the entire program, and make sure that all other independent tasks/threads will receive the exit signal in a somewhat timely fashion and can perform their own teardown logic before exiting. Specifically we can avoid the cases where independent worker threads or tokio runtimes continue running after one of them Panics.
A ChexInstance can be acquired in two ways:
Usage guidelines:
See the examples/ folder for usage with a mix of independent tokio runtimes and non-async worker threads.