Part of the value of having an ambiguous retry package will be to be able to define ad-hoc logic.. and call it using the same method each time.
So let's look at the two things we will need in order to perform a retry.
- The retryer library code
- The retryable implementation
Imagine a Retryable
inteface such as the following. The interface defines Try()
method that can optionally return an error
.