summaryrefslogtreecommitdiff
path: root/watcher.go
blob: 05b8a65919710cf2e22bf70207d748cc17af202e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}