Skip to content

Commit

Permalink
extend examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Feb 19, 2019
1 parent 03c4cf1 commit 600e246
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ if err := retry.Try(interrupter, action, strategy.Limit(3)); err != nil {
// work with response
```

Or use Context

```go
ctx, cancel := context.WithTimeout(request.Context(), time.Minute)
defer cancel()

if err := retry.Try(ctx, action, strategy.Limit(3)); err != nil {
// handle error
}
// work with response
```

#### retry.TryContext

```go
Expand Down

0 comments on commit 600e246

Please sign in to comment.