timeoututil

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTimeout

func WithTimeout(ctx context.Context, timeout time.Duration, operation string, innerFunc func(ctx context.Context) error) error

WithTimeout runs innerFunc with a timeout.

If innerFunc returns context.DeadlineExceeded because this helper's local timeout fired, WithTimeout returns an error that includes operation and wraps context.DeadlineExceeded. This makes timeout errors easier to trace back to the specific River operation that introduced the timeout instead of surfacing only the generic "context deadline exceeded" message.

func WithTimeoutV

func WithTimeoutV[T any](ctx context.Context, timeout time.Duration, operation string, innerFunc func(ctx context.Context) (T, error)) (T, error)

WithTimeoutV runs innerFunc with a timeout and returns its value.

If innerFunc returns context.DeadlineExceeded because this helper's local timeout fired, WithTimeoutV returns an error that includes operation and wraps context.DeadlineExceeded. This makes timeout errors easier to trace back to the specific River operation that introduced the timeout instead of surfacing only the generic "context deadline exceeded" message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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