scheduler

package
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager - schedules all expression executions

func New

func New() *Manager

New - creates a new scheduler

func (*Manager) AddTask

func (m *Manager) AddTask(task *Task, autoStart bool) error

AddTask - adds a new task

func (*Manager) Exists added in v1.17.1

func (m *Manager) Exists(id string) bool

Exists - checks if a task exists

func (*Manager) GetNumTasks

func (m *Manager) GetNumTasks() int

GetNumTasks - returns the number of tasks

func (*Manager) GetTask added in v1.17.4

func (m *Manager) GetTask(id string) interface{}

GetTask - returns a task by it's ID

func (*Manager) GetTasks added in v1.17.2

func (m *Manager) GetTasks() []interface{}

GetTasks - returns a list of tasks

func (*Manager) GetTasksIDs added in v1.17.4

func (m *Manager) GetTasksIDs() []string

GetTasksIDs - returns a list of task IDs

func (*Manager) IsRunning added in v1.17.3

func (m *Manager) IsRunning(id string) bool

IsRunning - checks if a task is running

func (*Manager) RemoveTask

func (m *Manager) RemoveTask(id string) bool

RemoveTask - removes a task

func (*Manager) StartTask

func (m *Manager) StartTask(id string) error

StartTask - starts a task

func (*Manager) StopTask

func (m *Manager) StopTask(id string) error

StopTask - stops a task

type Task

type Task struct {
	ID       string
	Duration time.Duration
	Job      job
	// contains filtered or unexported fields
}

Task - a scheduled task

func NewTask

func NewTask(id string, duration time.Duration, job job) *Task

NewTask - creates a new task

func (*Task) Start

func (t *Task) Start()

Start - starts to run this task

func (*Task) Stop

func (t *Task) Stop()

Stop - stops the task

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL