scheduler

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 2 Imported by: 1

README

scheduler

GoDoc CI codecov Release

A simple scheduler to run jobs periodically.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runnable

type Runnable func() error

Runnable is a task that can be run

type Scheduler

type Scheduler struct {
	Name string
	// contains filtered or unexported fields
}

Scheduler runs jobs periodically

func New

func New(name string, task Runnable, interval string) *Scheduler

New creates a new Scheduler. Valid time units for interval are "ns", "us", "ms", "s", "m", "h"

func (*Scheduler) Start

func (s *Scheduler) Start()

Start starts the scheduler

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop stops the scheduler

Jump to

Keyboard shortcuts

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