summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-13 20:22:06 +0300
committerWolfy-J <[email protected]>2018-06-13 20:22:06 +0300
commit87fff670cc5a446f4c396c30d330ce7958e9f40f (patch)
tree4a6b39b015a4ca8a49b0a3cd4874a3a2d0f9446f
parent1073eae0a28c6c4603763e79437891e6acdcc988 (diff)
additional event
-rw-r--r--pool.go3
-rw-r--r--static_pool.go1
2 files changed, 4 insertions, 0 deletions
diff --git a/pool.go b/pool.go
index 121967c5..30c30dfa 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 df20ad20..9449ea0c 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()