Closed stefnats closed 3 years ago
Sorry for the delay.
I'd like to wait (or handle the retrypolicy) until the call was successful and then go ahead.
To clarify, you'd like to wait until a call is successful before going ahead with a retry? Once a call is successful a retry wouldn't be needed. If you want to delay between retries, you can do that of course. https://jodah.net/failsafe/javadoc/net/jodah/failsafe/RetryPolicy.html#withDelay-java.time.Duration-
Closing for now. Please reopen if needed for further discussion.
Hey there,
I'm using failsafe to call an API and do auto-retries on throttle/limit exceptions.
However, i'm using a
Executors.newSingleThreadExecutor()
in theFailsafe.with(executor).getAsync(this::callTheApi)
command.Now, this is the problem. When i have, let's say 10 calls, and at call 5 the exception is caught, call 6 gets automatically executed without waiting. I'd like to wait (or handle the retrypolicy) until the call was successful and then go ahead. Is it clear what i tried to explain?
Thanks in advance!