engine

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface added in v0.4.0

type Interface interface {
	Run(ctx context.Context) error
	API() internalapi.Interface
}

func New

func New(opts Options) (Interface, error)

type Options

type Options struct {
	// Log is the logger to use for logging.
	Log logr.Logger

	// Key is the key to use for storing cron entries.
	Key *key.Key

	// Partitioner is the partitioner to use for partitioning cron entries.
	Partitioner partitioner.Interface

	// Client is the etcd client to use for storing cron entries.
	Client client.Interface

	// TriggerFn is the function to call when a cron job is triggered.
	TriggerFn api.TriggerFunction

	// CounterGarbageCollectionInterval is the interval at which to run the
	// garbage collection for counters is run. Counters are also garbage
	// collected on shutdown. Counters are batch deleted, so a larger value
	// increases the counter bucket and reduces the number of database
	// operations.
	// This value rarely needs to be set and is mostly used for testing. A small
	// interval value will increase database operations and thus degrade cron
	// performance.
	// Defaults to 180 seconds.
	CounterGarbageCollectionInterval *time.Duration
}

Options are the options for creating a new engine instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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