kite: github.com/koding/kite/kontrol/onceevery Index | Files

package onceevery

import "github.com/koding/kite/kontrol/onceevery"

Index

Package Files

onceevery.go

type OnceEvery Uses

type OnceEvery struct {
    Interval time.Duration
    // contains filtered or unexported fields
}

OnceEvery is an object that will perform exactly one action every given interval.

func New Uses

func New(d time.Duration) *OnceEvery

NewOnceEvery creates a new OnceEvery struct

func (*OnceEvery) Do Uses

func (o *OnceEvery) Do(f func())

Do calls the function f if and only if Do hits the given periodic interval. In other words Do can be called multiple times during the interval but it gets called only once if it hits the interval tick. So if the interval is 10 seconds, and a total of 100 calls are made during this period, f will be called it every 10 seconds.

Package onceevery imports 2 packages (graph) and is imported by 11 packages. Updated 2016-07-18. Refresh now. Tools for package owners.