We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Why an active computation thread got interrupted while window is finished?
Observable .intervalRange(0, 2, 0, 1, TimeUnit.SECONDS) .window(1, TimeUnit.SECONDS) .doOnNext(i -> { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start+1500) { } if (Thread.interrupted()) { System.out.println("WTF? Thread is interrupted!"); } }) .ignoreElements() .blockingAwait();
Is it a bug?
The text was updated successfully, but these errors were encountered:
This is a shortcoming of the window operator that cancels the timer before terminating, which interrupts the long running code in doOnNext.
doOnNext
A workaround would be to move the computation to yet another thread with observeOn so that the interrupt won't reach it.
observeOn
I'll look into the termination and timer cancellation ordering to avoid such confusing interrupts.
Sorry, something went wrong.
Could you fix it for 2.x too?
If it can be fixed, both 2.x and 3.x will receive the fix.
Successfully merging a pull request may close this issue.
Why an active computation thread got interrupted while window is finished?
Is it a bug?
The text was updated successfully, but these errors were encountered: