Skip to content
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

2.x: improve Flowable.timeout() #5661

Merged
merged 3 commits into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

232 changes: 0 additions & 232 deletions src/main/java/io/reactivex/internal/subscriptions/FullArbiter.java

This file was deleted.

6 changes: 3 additions & 3 deletions src/main/java/io/reactivex/schedulers/TestScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public void triggerActions() {
}

private void triggerActions(long targetTimeInNanoseconds) {
while (!queue.isEmpty()) {
for (;;) {
TimedRunnable current = queue.peek();
if (current.time > targetTimeInNanoseconds) {
if (current == null || current.time > targetTimeInNanoseconds) {
break;
}
// if scheduled time is 0 (immediate) use current virtual time
time = current.time == 0 ? time : current.time;
queue.remove();
queue.remove(current);

// Only execute if not unsubscribed
if (!current.scheduler.disposed) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/reactivex/flowable/FlowableNullTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ public void timeoutFirstItemNull() {

@Test(expected = NullPointerException.class)
public void timeoutFirstItemReturnsNull() {
just1.timeout(just1, new Function<Integer, Publisher<Object>>() {
just1.timeout(Flowable.never(), new Function<Integer, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Integer v) {
return null;
Expand Down
Loading