summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-04-15 12:48:06 +0300
committerWolfy-J <[email protected]>2018-04-15 12:48:06 +0300
commite2c1c66d7a35a9c60a4f05126691242068ebb589 (patch)
tree76db075971f2fe683ed3bf643bbf097b47178a5a
parentf8ff7aeedc893969d02115d23b62503a75228446 (diff)
report instead of observe
-rw-r--r--pool.go2
-rw-r--r--static_pool.go4
-rw-r--r--static_pool_test.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/pool.go b/pool.go
index e432ec25..d22830a6 100644
--- a/pool.go
+++ b/pool.go
@@ -13,7 +13,7 @@ const (
// Pool managed set of inner worker processes.
type Pool interface {
- // Watch attaches pool event watcher.
+ // Report attaches pool event watcher.
Watch(o func(event int, w *Worker, ctx interface{}))
// Exec one task with given payload and context, returns result or error.
diff --git a/static_pool.go b/static_pool.go
index c119a270..c4895bf0 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -70,8 +70,8 @@ func NewPool(cmd func() *exec.Cmd, factory Factory, cfg Config) (*StaticPool, er
return p, nil
}
-// Watch attaches pool event watcher.
-func (p *StaticPool) Watch(o func(event int, w *Worker, ctx interface{})) {
+// Report attaches pool event watcher.
+func (p *StaticPool) Report(o func(event int, w *Worker, ctx interface{})) {
p.observer = o
}
diff --git a/static_pool_test.go b/static_pool_test.go
index ada6c3d2..b4069b98 100644
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -150,7 +150,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
assert.NotNil(t, p)
assert.NoError(t, err)
- p.Watch(func(e int, w *Worker, ctx interface{}) {
+ p.Report(func(e int, w *Worker, ctx interface{}) {
if err, ok := ctx.(error); ok {
assert.Contains(t, err.Error(), "undefined_function()")
}