Skip to content

Commit

Permalink
additional event
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Jun 13, 2018
1 parent 1073eae commit 87fff67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pool.go
Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions static_pool.go
Expand Up @@ -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()
Expand Down

0 comments on commit 87fff67

Please sign in to comment.