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.