summaryrefslogtreecommitdiff
path: root/pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-28 18:58:06 +0300
committerWolfy-J <[email protected]>2018-01-28 18:58:06 +0300
commit730c76737a64c798b37adefb15ea0f223361631b (patch)
tree0c61e5298abc97acc33a22d086e208f0d6e308b3 /pool.go
parent71a040f5ee98d91e9f388b0d4509adf8d5589bb9 (diff)
Context
Diffstat (limited to 'pool.go')
-rw-r--r--pool.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pool.go b/pool.go
index deb24fd7..dfa7ab1b 100644
--- a/pool.go
+++ b/pool.go
@@ -26,8 +26,8 @@ const (
// Pool controls worker creation, destruction and task routing.
type Pool struct {
- // EventHandler is optional callback to handle worker create/destruct/error events.
- EventHandler func(event int, w *Worker, ctx interface{})
+ // Observer is optional callback to handle worker create/destruct/error events.
+ Observer func(event int, w *Worker, ctx interface{})
// pool behaviour
cfg Config
@@ -236,7 +236,7 @@ func (p *Pool) createWorker() (*Worker, error) {
// throw invokes event handler if any.
func (p *Pool) throw(event int, w *Worker, ctx interface{}) {
- if p.EventHandler != nil {
- p.EventHandler(event, w, ctx)
+ if p.Observer != nil {
+ p.Observer(event, w, ctx)
}
}