scheduler

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At

func At(date time.Time) oncespec

At func just store the given time for this schedule.

func Every

func Every(duration time.Duration) everyspec

Every returns a crontab Schedule that activates once every duration. Delays of less than a second are not supported (will round up to 1 second). Any fields less than a Second are truncated.

func Prepare

func Prepare(spec string) (_ analyzer, err error)

Prepare This func return a new analyzer by spec spec can be:

  • crontab specs, e.g. "* * * * * *" (second) (minute) (hour) (day of month) (month) (day of week)
  • Descriptors, e.g. "@midnight", "@every 1h"

Types

type Scheduler

type Scheduler struct {
	RunJobCh chan *pb.Job
	// contains filtered or unexported fields
}

func New

func New(runjobCh chan *pb.Job) *Scheduler

func (*Scheduler) AddJob

func (s *Scheduler) AddJob(job *pb.Job) error

func (*Scheduler) DeleteJob

func (s *Scheduler) DeleteJob(job *pb.Job)

func (*Scheduler) JobCount

func (s *Scheduler) JobCount() int

func (*Scheduler) JobExist

func (s *Scheduler) JobExist(job *pb.Job) bool

func (*Scheduler) Start

func (s *Scheduler) Start()

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Jump to

Keyboard shortcuts

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