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 ¶
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.
Click to show internal directories.
Click to hide internal directories.