From 87fff670cc5a446f4c396c30d330ce7958e9f40f Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 13 Jun 2018 20:22:06 +0300 Subject: [PATCH] additional event --- pool.go | 3 +++ static_pool.go | 1 + 2 files changed, 4 insertions(+) diff --git a/pool.go b/pool.go index 121967c5f..30c30dfaf 100644 --- a/pool.go +++ b/pool.go @@ -13,6 +13,9 @@ const ( // EventWorkerError thrown any worker related even happen (passed with WorkerError) EventWorkerError + // EventWorkerDead thrown when worker stops worker for any reason. + EventWorkerDead + // EventPoolError caused on pool wide errors EventPoolError ) diff --git a/static_pool.go b/static_pool.go index df20ad209..9449ea0cc 100644 --- a/static_pool.go +++ b/static_pool.go @@ -239,6 +239,7 @@ func (p *StaticPool) destroyWorker(w *Worker, caused interface{}) { // watchWorker watches worker state and replaces it if worker fails. func (p *StaticPool) watchWorker(w *Worker) { err := w.Wait() + p.throw(EventWorkerDead, w) // detaching p.muw.Lock()