Documentation ¶
Overview ¶
Package scheduler provides the `Scheduler` interface that should be implemented for any scheduler that wants to plug in `autodiscovery`. It also defines the `MetaScheduler` which dispatches all instructions from `autodiscovery` to all the registered schedulers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaScheduler ¶
type MetaScheduler struct {
// contains filtered or unexported fields
}
MetaScheduler is a scheduler dispatching to all its registered schedulers
func NewMetaScheduler ¶
func NewMetaScheduler() *MetaScheduler
NewMetaScheduler inits a meta scheduler
func (*MetaScheduler) Deregister ¶
func (ms *MetaScheduler) Deregister(name string)
Deregister a scheduler in the meta scheduler to dispatch to
func (*MetaScheduler) Register ¶
func (ms *MetaScheduler) Register(name string, s Scheduler, replayConfigs bool)
Register a new scheduler to receive configurations.
Previously scheduled configurations that have not subsequently been unscheduled can be replayed with the replayConfigs flag. This replay occurs immediately, before the AddScheduler call returns.
func (*MetaScheduler) Schedule ¶
func (ms *MetaScheduler) Schedule(configs []integration.Config)
Schedule schedules configs to all registered schedulers
func (*MetaScheduler) Stop ¶
func (ms *MetaScheduler) Stop()
Stop handles clean stop of registered schedulers
func (*MetaScheduler) Unschedule ¶
func (ms *MetaScheduler) Unschedule(configs []integration.Config)
Unschedule unschedules configs to all registered schedulers
type Scheduler ¶
type Scheduler interface { // Schedule zero or more new configurations. Schedule([]integration.Config) // Unschedule zero or more configurations that were previously scheduled. Unschedule([]integration.Config) // Stop the scheduler. This method is called from the MetaScheduler's Stop // method. Note that currently-scheduled configs are _not_ unscheduled when // the MetaScheduler stops. Stop() }
Scheduler is the interface that should be implemented if you want to schedule and unschedule integrations. Values implementing this interface can be passed to the MetaScheduler's Register method (or AutoConf.AddScheduler).