mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-27 11:53:53 +00:00
run hack/{pind-dependency.sh, update-vendor.sh}
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
17
vendor/k8s.io/utils/clock/clock.go
generated
vendored
17
vendor/k8s.io/utils/clock/clock.go
generated
vendored
@@ -53,6 +53,16 @@ type WithTicker interface {
|
||||
NewTicker(time.Duration) Ticker
|
||||
}
|
||||
|
||||
// WithDelayedExecution allows for injecting fake or real clocks into
|
||||
// code that needs to make use of AfterFunc functionality.
|
||||
type WithDelayedExecution interface {
|
||||
Clock
|
||||
// AfterFunc executes f in its own goroutine after waiting
|
||||
// for d duration and returns a Timer whose channel can be
|
||||
// closed by calling Stop() on the Timer.
|
||||
AfterFunc(d time.Duration, f func()) Timer
|
||||
}
|
||||
|
||||
// Ticker defines the Ticker interface.
|
||||
type Ticker interface {
|
||||
C() <-chan time.Time
|
||||
@@ -88,6 +98,13 @@ func (RealClock) NewTimer(d time.Duration) Timer {
|
||||
}
|
||||
}
|
||||
|
||||
// AfterFunc is the same as time.AfterFunc(d, f).
|
||||
func (RealClock) AfterFunc(d time.Duration, f func()) Timer {
|
||||
return &realTimer{
|
||||
timer: time.AfterFunc(d, f),
|
||||
}
|
||||
}
|
||||
|
||||
// Tick is the same as time.Tick(d)
|
||||
// This method does not allow to free/GC the backing ticker. Use
|
||||
// NewTicker instead.
|
||||
|
||||
Reference in New Issue
Block a user