Skip to content

Commit 3f330b7

Browse files
committed
Add documentation about restarting and backoff
1 parent 34ee4aa commit 3f330b7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,31 @@ if err != nil {
203203
}
204204
```
205205

206+
### Restarting Players
207+
208+
A player can be configured to restart, possibly with exponential backoff by implementing the `PlayerWithBackoff` interface.
209+
210+
For example:
211+
212+
```go
213+
package main
214+
215+
import "github.com/cenkalti/backoff/v4"
216+
217+
type playerThatRestartsImmediately struct{}
218+
219+
func (playerThatRestartsImmediately) Backoff() backoff.BackOff {
220+
return &backoff.ZeroBackOff{}
221+
}
222+
223+
224+
type playerWithExponentialBakoff struct{}
225+
226+
func (playerWithExponentialBakoff) Backoff() backoff.BackOff {
227+
return backoff.NewExponentialBackOff()
228+
}
229+
```
230+
206231
## Customization
207232

208233
The logger can be modified by assigning a logger to `orchestra.Logger`

0 commit comments

Comments
 (0)