Documentation
¶
Overview ¶
Package clock defines the application's time dependency. time.Time and time.Duration remain value types; reading time and scheduling work use Clock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wait ¶
Wait waits for d on c or context cancellation. Cancellation takes precedence if ctx is already done when the timer completion is observed, including when both signals are ready. It returns ctx.Err() in that case, otherwise nil.
func WithDeadline ¶
func WithDeadline(parent context.Context, c Clock, deadline time.Time) (context.Context, context.CancelFunc)
WithDeadline preserves both parent Err and Cause. Clockwork's fake-context helper intentionally ignores parent deadline cancellation, which differs from the application's production cancellation contract.