job_function

package
v0.0.0-...-8438342 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function[R any] func(context.Context) (R, error)

Function represents an argument-less function which returns a generic type R and a possible error.

type FunctionJob

type FunctionJob[R any] struct {
	Result    *R
	Error     error
	JobStatus q.JobStatus
	// contains filtered or unexported fields
}

FunctionJob represents a Job that invokes the passed Function, implements the quartz.Job interface.

func NewFunctionJobWithKey

func NewFunctionJobWithKey[R any](key int, function Function[R]) *FunctionJob[R]

NewFunctionJob returns a new FunctionJob without an explicit description.

func (*FunctionJob[R]) Description

func (f *FunctionJob[R]) Description() string

Description returns the description of the FunctionJob.

func (*FunctionJob[R]) Execute

func (f *FunctionJob[R]) Execute(ctx context.Context)

Execute is called by a Scheduler when the Trigger associated with this job fires. It invokes the held function, setting the results in Result and Error members.

func (*FunctionJob[R]) Key

func (f *FunctionJob[R]) Key() int

Key returns the unique FunctionJob key.

Jump to

Keyboard shortcuts

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