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 returns a child context with a deadline that ensures that at least buffer amount of time remains after the child deadline expires and before the parent deadline expires. The returned context timeout is therefore <= the requested timeout. If the parent deadline itself does not allow buffer amount of time, then the returned context deadline expires immediately. Use this method to create child context when the child 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.
Click to show internal directories.
Click to hide internal directories.