summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-02 17:19:12 +0300
committerWolfy-J <[email protected]>2019-05-02 17:19:12 +0300
commita482d49122d92dd1cd82881ed221c55e5210e536 (patch)
treeb0a7de9e1866aca46a726694231d69fc0c012462
parent7bd5da5327e0d6f602627006d55cf803b8c4a4c7 (diff)
fixing tests
-rw-r--r--pool.go4
-rw-r--r--static_pool.go5
2 files changed, 7 insertions, 2 deletions
diff --git a/pool.go b/pool.go
index 7dfea26c..8372b4a6 100644
--- a/pool.go
+++ b/pool.go
@@ -22,6 +22,10 @@ const (
// Pool managed set of inner worker processes.
type Pool interface {
+ // Watch enables worker watching (to destroy expired workers or workers which experience
+ // memory leaks).
+ Watch(w Watcher)
+
// Listen all caused events to attached watcher.
Listen(l func(event int, ctx interface{}))
diff --git a/static_pool.go b/static_pool.go
index 336ae520..69edfd35 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -81,8 +81,9 @@ func NewPool(cmd func() *exec.Cmd, factory Factory, cfg Config) (*StaticPool, er
return p, nil
}
-// WatchWorkers enables worker watching.
-func (p *StaticPool) WatchWorkers(w Watcher) {
+// Watch enables worker watching (to destroy expired workers or workers which experience
+// memory leaks).
+func (p *StaticPool) Watch(w Watcher) {
p.mul.Lock()
defer p.mul.Unlock()