Skip to content
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

Add failAfterTime to limit maximum time elapsed #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinoid
Copy link

@kevinoid kevinoid commented Feb 4, 2017

This commit adds a failAfterTime method to Backoff (and FunctionCall) to allow limiting the total elapsed time. The primary intended use case is when the caller has a deadline which can not be exceeded during which to retry an operation with backoff and the number of backoffs can not be
calculated in advance (e.g. because the operation takes a variable amount of time). In my current use case, this is calling a REST API using backoff up to a deadline.

Thanks for considering,
Kevin

This commit adds the failAfterTime method to Backoff (and FunctionCall)
to allow limiting the total elapsed time.  The primary intended use case
is when the caller has a deadline which can not be exceeded during which
to retry an operation with backoff and the number of backoffs can not be
calculated in advance (e.g. because the operation takes a variable
amount of time).

Signed-off-by: Kevin Locke <[email protected]>
@kevinoid
Copy link
Author

Ping. Thoughts?

@alizain
Copy link

alizain commented Feb 26, 2017

@MathieuTurcotte ping?

@MathieuTurcotte
Copy link
Owner

The change makes sense at a glance. I'll try to take a closer look this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants