cron

package
v0.0.0-...-dae269f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

type Cron struct {
	component.Base
	Dependencies struct {
		Tasks []component.Cronable
	}
}

func (*Cron) Listen

func (control *Cron) Listen(ctx context.Context) (<-chan struct{}, func())

Listen returns a channel that listens for triggers in the current process. It is intended to be passed to Start.

func (*Cron) Once

func (control *Cron) Once(ctx context.Context)

Once immediatly runs all cron jobs in the current thread. Once returns once all cron jobs have returned.

Once should not be called concurrently with Cron.

func (*Cron) Start

func (control *Cron) Start(ctx context.Context, signal <-chan struct{}) <-chan struct{}

Start invokes all cron jobs regularly, waiting between invocations as specified in configuration.

A first run is invoked immediatly. The call to Start returns after the first invocation of all cron tasks.

The returned channel is closed once no more cron tasks are active.

Jump to

Keyboard shortcuts

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