periodic

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 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 Manager

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

Manager syncs periodic tasks from an external config source into the dureq scheduler. It adds new tasks, updates changed tasks, and removes tasks that no longer appear in the provider output.

func NewManager

func NewManager(cfg ManagerConfig) *Manager

NewManager creates a new periodic task manager.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context)

Start begins the sync loop.

func (*Manager) Stop

func (m *Manager) Stop()

Stop halts the sync loop.

type ManagerConfig

type ManagerConfig struct {
	// Provider returns the current set of periodic task configs.
	Provider types.PeriodicTaskConfigProvider

	// Client is the dureq client used to enqueue/update schedules.
	Client *client.Client

	// SyncInterval is how often to re-sync with the provider. Default: 1m.
	SyncInterval time.Duration

	Logger chainedlog.Logger
}

ManagerConfig configures the PeriodicTaskManager.

Jump to

Keyboard shortcuts

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