summaryrefslogtreecommitdiff
path: root/watcher.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-02 17:30:43 +0300
committerWolfy-J <[email protected]>2019-05-02 17:30:43 +0300
commit8fc464213c471ad79be88d9926d8f45b66a23ec0 (patch)
tree4072167f6ca3a2d4bd9ed56ff9c017c8ed79e16a /watcher.go
parenta482d49122d92dd1cd82881ed221c55e5210e536 (diff)
removing workers in runtime
Diffstat (limited to 'watcher.go')
-rw-r--r--watcher.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/watcher.go b/watcher.go
index bbc7b9dc..05b8a659 100644
--- a/watcher.go
+++ b/watcher.go
@@ -1,8 +1,22 @@
package roadrunner
+import (
+ "sync"
+ "time"
+)
+
// Watcher watches for workers.
type Watcher interface {
// Keep must return true and nil if worker is OK to continue working,
// must return false and optional error to force worker destruction.
Keep(p Pool, w *Worker) (keep bool, err error)
}
+
+// disconnect??
+type LazyWatcher struct {
+ // defines how often
+ interval time.Duration
+
+ mu sync.Mutex
+ p Pool
+}