Documentation ¶
Index ¶
Constants ¶
const (
//DefaultTickDuration is default state for metrics
DefaultTickDuration = 1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Enabled bool `toml:"enabled"` TickDuration toml.Duration `toml:"tick-duration"` LogTasksDetection bool `toml:"log-task-detection"` HTTPExecutor http.Config `toml:"executor-http"` LocalExecutor local.Config `toml:"executor-local"` CrontabSource crontab.Config `toml:"provider-crontab"` ETCDSource etcd.Config `toml:"provider-etcd"` SQLSource sql.Config `toml:"provider-sql"` NumWorkers int `toml:"num-workers"` }
Config represents the meta configuration.
type Dispatcher ¶
type Dispatcher struct { WorkerQueue chan chan *provider.Task WorkQueue chan *provider.Task Workers []*Worker }
Dispatcher for spinning up workers and distributing work
func StartDispatcher ¶
func StartDispatcher(nworkers int, eps map[string]provider.ExecutionProvider, reporters []adapters.Reporter) *Dispatcher
StartDispatcher starts the dispatching provider
type Service ¶
type Service struct { Config *Config Logger *logrus.Logger Cancel chan struct{} Ticker *time.Ticker ExecutionProviders map[string]provider.ExecutionProvider Reporters []adapters.Reporter JobDispatcher *Dispatcher TaskRunner *Tasks }
Service Returns a config
func NewService ¶
NewService creates a new service
func (*Service) RegisterExecutionProvider ¶
func (s *Service) RegisterExecutionProvider(name string, provider provider.ExecutionProvider)
RegisterExecutionProvider registers or overwrites an execution provider
type Tasks ¶
type Tasks struct { BasePath string Tasks map[string]*provider.Task SourceProviders []provider.SourceProvider }
Tasks store all the structural data needed to run the cronjobs
func NewSourceConfig ¶
NewSourceConfig returns a new Task archive
func (*Tasks) DebugTasks ¶
DebugTasks dumps all tasks inside the task archive
type Worker ¶
type Worker struct { ID int Work chan *provider.Task WorkerQueue chan chan *provider.Task Reporters []adapters.Reporter QuitChan chan bool ExecutionProviders map[string]provider.ExecutionProvider Callbacks map[string]func(*provider.Task) error }
Worker defines a working horse for tasks
func NewWorker ¶
func NewWorker(id int, workerQueue chan chan *provider.Task, eps map[string]provider.ExecutionProvider, reporters []adapters.Reporter) Worker
NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.
func (*Worker) LogReporters ¶
LogReporters fans out to reporters.
func (*Worker) Start ¶
func (w *Worker) Start()
Start function "starts" the worker by starting a goroutine, that is an infinite "for-select" loop.