Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Clock = clock.NewClock()
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct { Locker lock.LockFactory Component Component Runnable Runnable }
Coordinator ensures that the given component is not executed concurrently.
func (*Coordinator) RunImmediately ¶
func (coordinator *Coordinator) RunImmediately(ctx context.Context)
func (*Coordinator) RunPeriodically ¶
func (coordinator *Coordinator) RunPeriodically(ctx context.Context)
type Drainable ¶
Drainable is an optional interface which component runners can implement in order to perform something on shutdown.
type NotificationsBus ¶
type Runnable ¶
type Runnable interface { // Run is invoked repeatedly. The component should perform whatever work is // available and return. Run(context.Context) error }
Runnable represents a workload to execute.
type Runner ¶
type Runner struct { Logger lager.Logger Interval time.Duration Component Component Bus NotificationsBus Schedulable Schedulable }
Runner runs a workload periodically, or immediately upon receiving a notification.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.