summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
committerWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
commit3fe85e9d92f5f98337e8f7fd9a14e6b66b9694bd (patch)
tree2575fbba16df4f95dd392f231ad7d7b30a5dd4ef /static_pool.go
parent4c292ee46f5505b00b16186e8f30e9bc1be25895 (diff)
http service
Diffstat (limited to 'static_pool.go')
-rw-r--r--static_pool.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/static_pool.go b/static_pool.go
index f4652bfc..a4391005 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -21,8 +21,8 @@ type StaticPool struct {
// worker command creator
cmd func() *exec.Cmd
- // observer is optional callback to handle worker create/destruct/error events.
- observer func(event int, ctx interface{})
+ // listener is optional callback to handle worker create/destruct/error events.
+ listener func(event int, ctx interface{})
// creates and connects to workers
factory Factory
@@ -69,9 +69,9 @@ func NewPool(cmd func() *exec.Cmd, factory Factory, cfg Config) (*StaticPool, er
return p, nil
}
-// Observe attaches pool event watcher.
-func (p *StaticPool) Observe(o func(event int, ctx interface{})) {
- p.observer = o
+// Listen attaches pool event watcher.
+func (p *StaticPool) Listen(l func(event int, ctx interface{})) {
+ p.listener = l
}
// Config returns associated pool configuration. Immutable.
@@ -253,7 +253,7 @@ func (p *StaticPool) destroyWorker(w *Worker) {
// throw invokes event handler if any.
func (p *StaticPool) throw(event int, ctx interface{}) {
- if p.observer != nil {
- p.observer(event, ctx)
+ if p.listener != nil {
+ p.listener(event, ctx)
}
}