diff options
author | Wolfy-J <[email protected]> | 2019-05-02 22:47:51 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-05-02 22:47:51 +0300 |
commit | e3f8f80b40d55d9d3c2e858a73cc1befe3f04114 (patch) | |
tree | 958aed22ee91436d9302709f4364928fc66b98e5 /watcher.go | |
parent | b7637290225bf6fab2e41a55d9b9a6bd3f36142c (diff) |
symfony way to refernce contributors
Diffstat (limited to 'watcher.go')
-rw-r--r-- | watcher.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/watcher.go b/watcher.go deleted file mode 100644 index 3b654c34..00000000 --- a/watcher.go +++ /dev/null @@ -1,50 +0,0 @@ -package roadrunner - -import ( - "log" - "time" -) - -// disconnect?? -type Watcher struct { - // defines how often - interval time.Duration - pool Pool - - stop chan interface{} -} - -// NewWatcher creates new pool watcher. -func NewWatcher(p Pool, i time.Duration) *Watcher { - w := &Watcher{ - interval: i, - pool: p, - stop: make(chan interface{}), - } - - go func() { - ticker := time.NewTicker(w.interval) - - for { - select { - case <-ticker.C: - w.update() - case <-w.stop: - return - } - } - }() - - return w -} - -func (w *Watcher) Stop() { - close(w.stop) -} - -func (w *Watcher) update() { - for _, w := range w.pool.Workers() { - log.Println(w) - - } -} |