cron

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(workdir string, pool *Pool, log logger.Logger) error

Load loads all shigoto files from the given workdir and registers it to the given pool and starts them. It reload already registred shigoto if a change is detected.

Types

type Pool

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

A Pool contains a pool of crons and carries lots of helping methods.

func New

func New(l logger.Logger) *Pool

New returns a new Pool.

func (*Pool) Get

func (p *Pool) Get(name string) *shigoto.Shigoto

Get returns the registred shigoto according the given name.

func (*Pool) Register

func (p *Pool) Register(s *shigoto.Shigoto)

Register adds the given shigoto to the cron pool.

func (*Pool) Start

func (p *Pool) Start()

Start start all schedulers.

func (*Pool) StartShigoto

func (p *Pool) StartShigoto(name string)

StartShigoto starts the scheduler of the given shigoto's name.

func (*Pool) Stop

func (p *Pool) Stop()

Stop stops and waits for the termination of the tasks of all schedulers.

func (*Pool) StopShigoto

func (p *Pool) StopShigoto(name string)

StopShigoto stops and waits for the termination of the tasks of the given shigoto.

Jump to

Keyboard shortcuts

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