FakeWatcher with channel size constructor
This commit is contained in:
@@ -89,6 +89,12 @@ func NewFake() *FakeWatcher {
|
||||
}
|
||||
}
|
||||
|
||||
func NewFakeWithChanSize(size int) *FakeWatcher {
|
||||
return &FakeWatcher{
|
||||
result: make(chan Event, size),
|
||||
}
|
||||
}
|
||||
|
||||
// Stop implements Interface.Stop().
|
||||
func (f *FakeWatcher) Stop() {
|
||||
f.Lock()
|
||||
@@ -99,6 +105,12 @@ func (f *FakeWatcher) Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FakeWatcher) IsStopped() bool {
|
||||
f.Lock()
|
||||
defer f.Unlock()
|
||||
return f.Stopped
|
||||
}
|
||||
|
||||
// Reset prepares the watcher to be reused.
|
||||
func (f *FakeWatcher) Reset() {
|
||||
f.Lock()
|
||||
|
||||
Reference in New Issue
Block a user