threadpool: add panic_handler (#1052)

This commit is contained in:
Ryan Dahl
2019-04-21 16:26:09 -07:00
committed by Carl Lerche
parent 712ca84033
commit fea1f780bc
4 changed files with 55 additions and 0 deletions
+2
View File
@@ -1,5 +1,6 @@
use callback::Callback;
use std::any::Any;
use std::fmt;
use std::sync::Arc;
use std::time::Duration;
@@ -14,6 +15,7 @@ pub(crate) struct Config {
pub around_worker: Option<Callback>,
pub after_start: Option<Arc<Fn() + Send + Sync>>,
pub before_stop: Option<Arc<Fn() + Send + Sync>>,
pub panic_handler: Option<Arc<Fn(Box<Any + Send>) + Send + Sync>>,
}
/// Max number of workers that can be part of a pool. This is the most that can