func NewPeriodicWorker(call PeriodicWorkerCall, period time.Duration, timerFunc NewTimerFunc, options ...PeriodicWorkerOption) worker.Worker {
	w := &periodicWorker{newTimer: timerFunc}
	for _, option := range options {
		option(w)
	}
	w.tomb.Go(func() error {
		return w.run(call, period)
	})
	return w
}
// NewPeriodicWorker returns a worker that runs the given function continually
// sleeping for sleepDuration in between each call, until Kill() is called
// The stopCh argument will be closed when the worker is killed. The error returned
// by the doWork function will be returned by the worker's Wait function.
NewPeriodicWorker returns a worker that runs the given function continually
sleeping for sleepDuration in between each call, until Kill() is called
The stopCh argument will be closed when the worker is killed. The error returned
by the doWork function will be returned by the worker's Wait function.
// NewPeriodicWorker returns a worker that runs the given function continually // sleeping for sleepDuration in between each call until Kill () is called // The stopCh argument will be closed when the worker is killed . The error returned // by the doWork function will be returned by the worker ' s Wait function .
func NewPeriodicWorker(call PeriodicWorkerCall, period time.Duration, timerFunc NewTimerFunc, options ...PeriodicWorkerOption) worker.Worker {
	w := &periodicWorker{newTimer: timerFunc}
	for _, option := range options {
		option(w)
	}
	w.tomb.Go(func() error {
		return w.run(call, period)
	})
	return w
}
func NewPeriodicWorker ( call PeriodicWorkerCall , period time . Duration , timerFunc NewTimerFunc , options ... PeriodicWorkerOption ) worker . Worker { w := & periodicWorker { newTimer : timerFunc } for _ , option := range options { option ( w ) } w . tomb . Go ( func ( ) error { return w . run ( call , period ) } ) return w }
NewPeriodicWorker returns a worker that runs the given function continually
sleeping for sleepDuration in between each call, until Kill() is called
The stopCh argument will be closed when the worker is killed.
NewPeriodicWorker returns a worker that runs the given function continually sleeping for sleepDuration in between each call until Kill () is called The stopCh argument will be closed when the worker is killed .