scheduler

package
v1.0.43 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 10 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, params Parameters) (goToNextJob bool, nextTick 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.38

type Parameters struct {
	// State is the real state of the system.
	State lifecycle.Classifier

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

	// ScheduleSpec is the scheduling options
	ScheduleSpec *v1alpha1.TaskSchedulerSpec

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

	// JobName is used a prefix for finding children tasks.
	// We assume the standard naming pattern Job-Task.
	JobName string

	// ScheduledJobs normally points to the next QueuedJobs.
	// In this case, we use it in conjunction with JobName to find the children's name,
	// and from that to extract the status of the child.
	ScheduledJobs int `json:"scheduledJobs,omitempty"`
}

type Timeline added in v1.0.38

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