contextutil

package
v1.29.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDeadlineBuffer

func WithDeadlineBuffer(
	parent context.Context,
	timeout time.Duration,
	buffer time.Duration,
) (context.Context, context.CancelFunc)

WithDeadlineBuffer creates a child context with desired timeout. If buffer is non-zero, then child context timeout will be the minOf(parentCtx.Deadline()-buffer, maxTimeout). Use this method to create child context when childContext cannot use all of parent's deadline but instead there is a need to leave some time for parent to do some post-work

Types

This section is empty.

Jump to

Keyboard shortcuts

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