cron

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Done added in v0.27.0

func Done() <-chan struct{}

Done returns a channel which is closed when the task is done. Currently, this channel is never closed to support cloudflare.WaitUntil feature.

func ScheduleTask

func ScheduleTask(task Task)

ScheduleTask sets the Task to be executed

func ScheduleTaskNonBlock added in v0.27.0

func ScheduleTaskNonBlock(task Task)

ScheduleTaskNonBlock sets the Task to be executed but does not signal readiness or block indefinitely. The non-blocking form is meant to be used in conjunction with workers.Serve.

Types

type Event

type Event struct {
	Cron          string
	ScheduledTime time.Time
}

Event represents information about the Cron that invoked this worker.

func NewEvent added in v0.23.0

func NewEvent(ctx context.Context) (*Event, error)

type Task

type Task func(ctx context.Context) error

Jump to

Keyboard shortcuts

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