execution

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybeApplyTimeout

func MaybeApplyTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)

MaybeApplyTimeout returns a context that will be cancelled after the given timeout. If the timeout is <= 0, the context will not be timed out, but it will still have a cancel function returned. In either case the cancel function should be called after execution (in a defer).

Types

type ContextKeyInsideTestWorker

type ContextKeyInsideTestWorker struct{}

ContextKeyInsideTestWorker is an internal context key that indicates whether the worker is running inside a [rivertest.Worker].

type Func

type Func func(ctx context.Context) error

func MiddlewareChain

func MiddlewareChain(globalMiddleware []rivertype.Middleware, workerMiddleware []rivertype.WorkerMiddleware, doInner Func, jobRow *rivertype.JobRow) Func

MiddlewareChain chains together the given middleware functions, returning a single function that applies them all in reverse order.

Jump to

Keyboard shortcuts

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