scheduler

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Schedule

func Schedule(log logr.Logger, obj client.Object, s Parameters) (goToNextJob bool, next time.Time, err error)

Schedule calculate the next scheduled run, and whether we've got a run that we haven't processed yet (or anything we missed). If we've missed a run, and we're still within the deadline to start it, we'll need to run a job. time-based and event-driven scheduling can be used in conjunction.

Types

type Parameters added in v1.0.28

type Parameters struct {
	// ScheduleSpec is the scheduling options
	ScheduleSpec *v1alpha1.SchedulerSpec

	// LastScheduled is the time the controller last scheduled an object.
	LastScheduled *metav1.Time

	// ExpectedTime is the evaluation of a timeline distribution defined in the ScheduleSpec.
	ExpectedTimeline v1alpha1.Timeline

	// State is the real state of the system.
	State *lifecycle.Classifier
}

type Timeline added in v1.0.28

type Timeline interface {
	// Next returns the next activation time, later than the given time.
	// Next is invoked initially, and then each time the job is run.
	Next(time.Time) time.Time
}

Timeline describes a job's duty cycle.

Jump to

Keyboard shortcuts

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