core: v2ray.com/core/common/retry Index | Files

package retry

import "v2ray.com/core/common/retry"

Index

Package Files

errors.generated.go retry.go

Variables

var (
    ErrRetryFailed = newError("all retry attempts failed")
)

type Strategy Uses

type Strategy interface {
    // On performs a retry on a specific function, until it doesn't return any error.
    On(func() error) error
}

Strategy is a way to retry on a specific function.

func ExponentialBackoff Uses

func ExponentialBackoff(attempts int, delay uint32) Strategy

func Timed Uses

func Timed(attempts int, delay uint32) Strategy

Timed returns a retry strategy with fixed interval.

Package retry imports 2 packages (graph) and is imported by 29 packages. Updated 2019-02-13. Refresh now. Tools for package owners.