jobloop

package
v0.19.1237 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsJobLoop

func AsJobLoop(f any) any

func AsManagementJobLoop

func AsManagementJobLoop(f any) any

func AsOperationsJobLoop

func AsOperationsJobLoop(f any) any

func New

func New(handlers []jobs.JobHandler, jobGroup models.AppRunnerJobGroup, params BaseParams, opts ...Option) *jobLoop

func WithJobLoops

func WithJobLoops(f any) any

func WithManagementJobLoops

func WithManagementJobLoops(f any) any

func WithOperationsJobLoops

func WithOperationsJobLoops(f any) any

Types

type BaseParams

type BaseParams struct {
	fx.In

	LC         fx.Lifecycle
	Shutdowner fx.Shutdowner

	Client      nuonrunner.Client
	Settings    *settings.Settings
	Cfg         *runnerconfig.Config
	ErrRecorder *errs.Recorder
	MW          metrics.Writer

	L *zap.Logger `name:"system"`

	ProcessRegistrar *process.Registrar
	Audit            *audit.Writer
	Drainer          *drain.Drainer
}

type Healthcheck

type Healthcheck struct {
	StartTime           time.Time
	StopTime            time.Time
	LatestHealthcheckAt time.Time
}

type JobLoop

type JobLoop interface {
	Start() error
	Stop() error
	LifecycleHook() fx.Hook
	// healthcheck
	GetHealthcheck() (Healthcheck, string)
	SetLatestHealthcheckAt() error
	TimeSinceLastHealthcheck() time.Duration
}

type Option added in v0.19.1126

type Option func(*jobLoop)

Option configures a job loop beyond its handlers and group.

func WithIdleHook added in v0.19.1126

func WithIdleHook(fn func(context.Context)) Option

WithIdleHook registers work to run when a poll finds no jobs, rate-limited to idleHookInterval. The image-actions loop uses it to collect cached action images only while it isn't running one.

Jump to

Keyboard shortcuts

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