Merge pull request #5270 from lavalamp/fix7

Controller framework
This commit is contained in:
Derek Carr
2015-04-07 16:58:09 -04:00
8 changed files with 427 additions and 21 deletions

View File

@@ -88,10 +88,14 @@ func logError(err error) {
}
// Forever loops forever running f every period. Catches any panics, and keeps going.
// Deprecated. Please use Until and pass NeverStop as the stopCh.
func Forever(f func(), period time.Duration) {
Until(f, period, nil)
}
// NeverStop may be passed to Until to make it never stop.
var NeverStop <-chan struct{} = make(chan struct{})
// Until loops until stop channel is closed, running f every period.
// Catches any panics, and keeps going. f may not be invoked if
// stop channel is already closed.