Crates.io | panic_monitor |
lib.rs | panic_monitor |
version | 0.2.1 |
source | src |
created_at | 2018-05-02 04:38:48.278231 |
updated_at | 2018-05-02 04:38:48.278231 |
description | helps you monitor your threads and deal with panics |
homepage | |
repository | https://github.com/asayers/panic_monitor |
max_upload_size | |
id | 63363 |
size | 23,495 |
=============
panic_monitor
=============
panic_monitor helps you monitor your threads and deal with panics. You might be tempted to use libstd's JoinHandles for this use-case; however, they have two major limitations:
panic_monitor solves both of these issues. PanicMonitor::wait() allows you to specify a number of threads, and it returns as soon as one of them panics. Threads are specified by their ThreadId (which is clonable), meaning that mulitple threads can monitor the same thread. Each call to PanicMonitor::wait() can specify a different set of watched threads.
When a watched thread panics, you get a Thread struct back (which contains the thread's name and ID). In contrast with JoinHandle::join(), you don't get the value which was passed to panic!() - this is not possible, given that this value is not required to implement Clone.
LICENCE
Licensed under either of the following, at your option:
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.