New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support contexts #34
Support contexts #34
Conversation
This also breaks the compatibility with older Go versions which don't have the context package. If you want to maintain the compatibility, we should be able to support older Go versions by declaring a backoff.Context interface, and accepting this interface instead of context.Context:
|
Added support for older Go versions:. This depends on "golang.org/x/net/context" instead of "context", as the former is always available. This makes the package compatible with all Go versions supported by "golang.org/x/net/context". It's still compatible with both "context" and "golang.org/x/net/context" packages. |
@arnaud-lb Sorry for the delay, I was quite busy this week. I still couldn't review this. I will do it as soon as possible. |
Is there any particular reason not to use the, in Go 1.7 introduced, context from the stdlib? |
@metalmatze see #40 |
Implements #32
At the API level, this adds:
Retry() and Ticker still accept BackOff implementations, but also support BackOffContext implementations.