summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/watcher/watcher.go (renamed from service/watchdog/watcher.go)12
-rw-r--r--watcher.go6
2 files changed, 12 insertions, 6 deletions
diff --git a/service/watchdog/watcher.go b/service/watcher/watcher.go
index c8c4b3f2..9cf129df 100644
--- a/service/watchdog/watcher.go
+++ b/service/watcher/watcher.go
@@ -1,4 +1,4 @@
-package watchdog
+package watcher
import (
"log"
@@ -6,7 +6,7 @@ import (
)
// disconnect??
-type Watcher struct {
+type Service struct {
// defines how often
interval time.Duration
pool Pool
@@ -15,8 +15,8 @@ type Watcher struct {
}
// NewWatcher creates new pool watcher.
-func NewWatcher(p Pool, i time.Duration) *Watcher {
- w := &Watcher{
+func NewWatcher(p Pool, i time.Duration) *Service {
+ w := &Service{
interval: i,
pool: p,
stop: make(chan interface{}),
@@ -38,11 +38,11 @@ func NewWatcher(p Pool, i time.Duration) *Watcher {
return w
}
-func (w *Watcher) Stop() {
+func (w *Service) Stop() {
close(w.stop)
}
-func (w *Watcher) update() {
+func (w *Service) update() {
for _, w := range w.pool.Workers() {
log.Println(w)
diff --git a/watcher.go b/watcher.go
new file mode 100644
index 00000000..7d9c6060
--- /dev/null
+++ b/watcher.go
@@ -0,0 +1,6 @@
+package roadrunner
+
+// disconnect??
+type Watcher interface {
+ // ?? lock on pool
+}