package backoff
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/backoff"
Index ¶
- Variables
- func New(opts ...option) logBackoff
- func WithCeiling(ceiling uint) option
- func WithClock(clock clockwork.Clock) option
- func WithJitterLimit(jitterLimit float64) option
- func WithSlotDuration(slotDuration time.Duration) option
- type Backoff
- type Type
Variables ¶
var ( Fast = New( WithSlotDuration(fastSlot), WithCeiling(6), ) Slow = New( WithSlotDuration(slowSlot), WithCeiling(6), ) )
Functions ¶
func New ¶
func New(opts ...option) logBackoff
func WithCeiling ¶
func WithCeiling(ceiling uint) option
func WithClock ¶
func WithJitterLimit ¶
func WithJitterLimit(jitterLimit float64) option
func WithSlotDuration ¶
Types ¶
type Backoff ¶
type Backoff interface { // Wait maps index of the retry to a channel which fulfillment means that // Delay is over. // // Note that retry index begins from 0 and 0-th index means that it is the // first retry attempt after an initial error. Wait(n int) <-chan time.Time // Delay returns mapping of i to Delay. Delay(i int) time.Duration }
Backoff is the interface that contains logic of delaying operation retry.
type Type ¶
type Type uint8
Type reports how to Backoff operation
Binary flags that used as Type
func (Type) String ¶
Source Files ¶
- Version
- v3.42.2
- Published
- Jan 9, 2023
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 19 minutes ago –
Tools for package owners.