8000 GitHub - squioc/chronos: Chronos is a job scheduler implementation
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

squioc/chronos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronos

import "github.com/squioc/chronos"

The chronos package provides a job scheduler implementation

Documentation:

The documentation is available at https://godoc.org/github.com/squioc/chronos, thanks to GoDoc

Usage

func NewChronos

func NewChronos(provider axis.Provider, queue Queue) *Chronos

Creates a new Scheduler with an axis.Provider and a chronos.Queue.

func Run

func (c *Chronos) Run(pushChan, workerChan chan Entry, stopChan chan bool)

Starts the scheduler (we recommend to use it in a goroutine).

Parameters:

  • pushChan is the input channel, which delivers jobs to schedule.
  • workerChan is the output channel, which receives jobs whose the position was reached.
  • stopChan allow to stop gracefully the scheduler.

type Entry

type Entry interface {
	Position() axis.Position
}

Entry is the interface that wraps elements to send in the scheduler

type Queue

type Queue interface {
	heap.Interface
	Peek() interface{}
}

Queue is the interface that holds elements as an ordered collection

About

Chronos is a job scheduler implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0