kaansari / retry

A simple retry package for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecated. Use https://github.com/tinrab/kit instead.

Retry

A simple retry package for Go.

Usage

Retry 10 times.

err := retry.Do(10, thisFunctionMayFail)
if err != nil {
  log.Fatal(err)
}

Retry with a delay.

err := retry.DoSleep(10, 3 * time.Second, thisFunctionMayFail)
if err != nil {
  log.Fatal(err)
}

Retry forever.

retry.Forever(thisFunctionMayFail)

About

A simple retry package for Go.

License:MIT License


Languages

Language:Go 100.0%