Documentation ¶
Index ¶
- func CheckUntil(f func() bool, dur time.Duration, stopCh <-chan struct{}) bool
- func CheckUntilImmediately(f func() bool, dur time.Duration, stopCh <-chan struct{}) bool
- func EachUntil(f func(), dur time.Duration, stopCh <-chan struct{})
- func EachUntilImmediately(f func(), dur time.Duration, stopCh <-chan struct{})
- type LazyRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUntil ¶ added in v0.2.5
CheckUntil run f each dur, until f return true or stopCh return when stop because f return true, CheckUntil return true when stop because stopCh return, CheckUntil return false
func CheckUntilImmediately ¶ added in v0.2.5
CheckUntilImmediately is an immediately version of CheckUntil CheckUntilImmediatelylike EachUntilImmediately to EachUntil
func EachUntilImmediately ¶
EachUntilImmediately like EachUntil but run f once immediately, unless stopCh already return
Types ¶
type LazyRunner ¶ added in v0.2.6
type LazyRunner struct { Run func(stopCh <-chan struct{}) Locker interface { sync.Locker RLock() RUnlock() } // protect supervisorStopChs, running, stoppedCh // contains filtered or unexported fields }
LazyRunner run Run only when there is at least one supervisor
func (*LazyRunner) AddSupervisor ¶ added in v0.2.6
func (lr *LazyRunner) AddSupervisor(stopCh <-chan struct{})
func (*LazyRunner) Wait ¶ added in v0.2.6
func (lr *LazyRunner) Wait()
Click to show internal directories.
Click to hide internal directories.