summaryrefslogtreecommitdiff
path: root/vendor/github.com/cenkalti/backoff/v4/timer.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/cenkalti/backoff/v4/timer.go')
-rw-r--r--vendor/github.com/cenkalti/backoff/v4/timer.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/vendor/github.com/cenkalti/backoff/v4/timer.go b/vendor/github.com/cenkalti/backoff/v4/timer.go
deleted file mode 100644
index 8120d0213..000000000
--- a/vendor/github.com/cenkalti/backoff/v4/timer.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package backoff
-
-import "time"
-
-type Timer interface {
- Start(duration time.Duration)
- Stop()
- C() <-chan time.Time
-}
-
-// defaultTimer implements Timer interface using time.Timer
-type defaultTimer struct {
- timer *time.Timer
-}
-
-// C returns the timers channel which receives the current time when the timer fires.
-func (t *defaultTimer) C() <-chan time.Time {
- return t.timer.C
-}
-
-// Start starts the timer to fire after the given duration
-func (t *defaultTimer) Start(duration time.Duration) {
- if t.timer == nil {
- t.timer = time.NewTimer(duration)
- } else {
- t.timer.Reset(duration)
- }
-}
-
-// Stop is called when the timer is not used anymore and resources may be freed.
-func (t *defaultTimer) Stop() {
- if t.timer != nil {
- t.timer.Stop()
- }
-}