cron

package
v0.0.0-...-c503993 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronJobEngine

type CronJobEngine interface {
	Start()
	AddJob(spec string, cmd cron.Job) (cron.EntryID, error)
	Remove(id cron.EntryID)
}

CronJobEngine basic interface to underlying cron job engine

type JobManager

type JobManager interface {
	AddCronJob(e types.Event) error
	RemoveCronJob(uri string) error
	TriggerEvent(e types.Event) error
}

JobManager job manager interface to add/remove running jobs

type Runner

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

Runner CRON runner

func NewCronRunner

func NewCronRunner(store types.EventStore, svc hermes.Service, limit int64) *Runner

NewCronRunner create new CRON runner with default cron job engine

func NewCronRunnerFull

func NewCronRunnerFull(store types.EventStore, svc hermes.Service, cron CronJobEngine, limit int64) *Runner

NewCronRunnerFull create new CRON runner with pluggable cron job engine

func (*Runner) AddCronJob

func (r *Runner) AddCronJob(e types.Event) error

AddCronJob add new CRON job

func (*Runner) RemoveCronJob

func (r *Runner) RemoveCronJob(uri string) error

RemoveCronJob remove CRON job

func (*Runner) TriggerEvent

func (r *Runner) TriggerEvent(e types.Event) error

TriggerEvent trigger event

type TriggerJob

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

TriggerJob struct that keeps event and triggers cron job execution

func (*TriggerJob) Run

func (job *TriggerJob) Run()

Run implements cron.Job interface

Jump to

Keyboard shortcuts

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