time

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 3 Imported by: 4

Documentation

Overview

package time contains a real time-based implementation of backoff.Sleeper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecondsRangeBackoff added in v0.1.1

func SecondsRangeBackoff() *backoff.Backoff

SecondsRangeBackoff returns a ready-to-use, generally useful backoff.Backoff that uses our Sleeper to start sleeping in the sub-second range and soon backs off to sleeping for a few seconds.

Types

type Sleeper

type Sleeper struct{}

Sleeper represents an implementation of backoff.Sleeper. It does an actual sleep using time.Sleep.

func (*Sleeper) Sleep

func (s *Sleeper) Sleep(ctx context.Context, d time.Duration)

Sleep sleeps until the context is cancelled, or the given duration has elapsed.

Jump to

Keyboard shortcuts

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