wrap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package wrap supplies Job decorators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(wrappers ...cron.Wrapper) cron.Wrapper

func DelayIfRunning

func DelayIfRunning() cron.Wrapper

DelayIfRunning serialises invocations; queued callers observe ctx cancellation.

func Recover

func Recover(opts ...Option) cron.Wrapper

Recover converts Job panics into errors and logs the stack.

func Retry

func Retry(p cron.RetryPolicy) cron.Wrapper

Retry is shorthand for p.Wrapper().

func SkipIfRunning

func SkipIfRunning() cron.Wrapper

SkipIfRunning drops overlapping invocations.

func Timeout

func Timeout(d time.Duration) cron.Wrapper

Timeout attaches a deadline with cron.ErrJobTimeout as the cancellation cause. Non-positive durations are a no-op.

Types

type Option

type Option func(*config)

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger sets the slog.Logger used by Recover. Default slog.Default().

Jump to

Keyboard shortcuts

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