scheduler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is a builder for creating a new scheduler.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new scheduler builder.

func (*Builder) Parse

func (b *Builder) Parse(job *api.Job) (*api.JobStored, error)

Parse parses a job into a stored job which contains a random partition ID.

func (*Builder) Scheduler

func (b *Builder) Scheduler(job *api.JobStored) (Interface, error)

Scheduler returns the scheduler based on the given stored job.

type Interface

type Interface interface {
	// Next returns the next trigger time for the schedule.
	// The given count is the number of times the trigger has been run.
	// The last parameter is the time the trigger was last run or job created
	// time.
	// Returns nil if the schedule will never trigger again.
	Next(count uint32, last *timestamppb.Timestamp) *time.Time
}

Interface is an interface which returns the next trigger time for a given parsed schedule.

Jump to

Keyboard shortcuts

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