-
Notifications
You must be signed in to change notification settings - Fork 17
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
It cancels the polls when the latency > interval #8
Comments
Good catch, I believe the solution would be using |
I’ll submit a PR tomorrow. I’ve been using a parched version locally with a similar solution in the end. |
I've been trying to work on a fix for this. However, the I'm not sure of the best solution. I've rewritten it to be like this in a test branch of our repo:
Which has it's own issues when implemented into this library... |
I've pushed the fix in You can see the changes here and they are quite minimal. Basically the approach has been changed into
The interval observable has been removed and the polling will repeat the next request only if the previous one has been completed/thrown. This normally should have the same result as before, but if the latency is big, there won't be issues hopefully. Tests seem to confirm the implementation. It's now important that provided |
It's an interesting approach with RXjs that I hadn't thought of. The interval with the take(1) is quite genius. I think you missed updating the demo files though as I went to quickly test the issue and noticed it still happened. |
Oh right, should be updated now. Anyway I've noticed that on error, the request is retried twice instead of once then correctly delayed based on strategy. Will add another patch release later, but it's not a big issue and I know the reason |
Take for example in your demo app (https://jiayihu.github.io/rx-polling/demo/).
If you set your latency in the chrome developer tools to >= inteval you end up never getting a successful poll?
Surely there should be an option to "queue" polls so that we can account for latency issues?
(I made a custom profile and set it to 3000ms latency to replicate this)
The text was updated successfully, but these errors were encountered: