Help us shape the future of Go! Take the 2026 Go Developer Survey

scheduler

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scheduler runs the platform's durable background work: running due automations (§9.3), returning expired delivery leases to the queue, recording interrupted connector attempts as unknown, and refreshing the operational gauges (§14).

Index

Constants

View Source
const StaleOperation = 15 * time.Minute

StaleOperation is how long an operation may stay pending before its attempt is presumed interrupted.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loop

type Loop struct {
	Store    Store
	Metrics  *metrics.Metrics
	Log      *slog.Logger
	Interval time.Duration
}

Loop runs the background work every Interval.

func (*Loop) Run

func (l *Loop) Run(ctx context.Context)

Run loops until ctx is cancelled.

func (*Loop) Tick

func (l *Loop) Tick(ctx context.Context)

Tick performs one round of background work.

type Store

type Store interface {
	FireDue(ctx context.Context, now time.Time, limit int) (int, error)
	RequeueExpired(ctx context.Context) (int, error)
	ExpireStaleOperations(ctx context.Context, olderThan time.Duration) (int64, error)
	Gauges(ctx context.Context) (*store.Gauges, error)
}

Store is the persistence the loop needs.

Jump to

Keyboard shortcuts

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