Skip to content

1.x: fix observeOn resource handling, add delayError capability#3682

Merged
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:ObserveOnCleanup1xV2
Feb 10, 2016
Merged

1.x: fix observeOn resource handling, add delayError capability#3682
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:ObserveOnCleanup1xV2

Conversation

@akarnokd
Copy link
Member

@akarnokd akarnokd commented Feb 9, 2016

This PR fixes the "messing around" reported in #3002 and adds an overload to observeOn that allows delaying errors without the need for wrapping (see #3542 and maybe there are other reports).

In addition, this PR adds a proper override of the isEmpty method to simply compare the two indexes for emptiness directly instead of size() == 0 to avoid looping, multi-reading and casting.

Benchmark comparison (i7 4790, Windows 7 x64, Java 8u66):

image

Note that the benchmark is generally quite noisy, yielding hectic results (i.e., firing up a thread with newThread may take quite some random microseconds). For example, observeOnImmediate shouldn't be affected by any of the changes yet the run-to-run variance is +/- 10%. I'm fine with the results of the benchmark.

@stevegury
Copy link
Member

👍

akarnokd added a commit that referenced this pull request Feb 10, 2016
1.x: fix observeOn resource handling, add delayError capability
@akarnokd akarnokd merged commit f8dcc93 into ReactiveX:1.x Feb 10, 2016
@akarnokd akarnokd deleted the ObserveOnCleanup1xV2 branch February 10, 2016 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants