-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature request: shouldRetry option should accept async functions #37
Comments
it sounds like a bit more complicated logic. Just from curiosity, how would you bring a new token into your source observable? |
It is a complicated logic. In that system, the token was saved for sharing (It was interacting with an ancient system) in a Redis instance. |
@BehzadV In my understanding, it should be handled before the retry operator, I would try something like:
that's the only possible solution that I see because then the retry will trigger execution, and it will run from the start, triggering the function that will get you a new token in case of failing But, let me know if you see a solution when you bring this getToken inside of the retry logic ( with |
@EugeneHerasymchuk I think the conversation has gotten overcomplicated, and too specific to my case. In my opinion, a |
Hello,
My feature request is that it would be better for the
retryBackoff
operator'sshouldRetry
option to also accept async functions (Promise).Let's say that I am calling an API within my operators but every once in a while I get a token error, which is caught within the
retryBackoff
, visible within theshouldRetry
option. I can use this opportunity to obtain a new token and then retry the call. However, I can't sinceshouldRetry
does not accept an async function.The text was updated successfully, but these errors were encountered: