Skip to content

Commit

Permalink
Merge pull request ReactiveX#1474 from mattrjacobs/ignore-backpressur…
Browse files Browse the repository at this point in the history
…e-operator-tosortedlist

Ignore backpressure for OperatorToObservableSortedList
  • Loading branch information
mattrjacobs committed Jul 22, 2014
2 parents 52c6ca0 + 160a758 commit 077d70a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public Subscriber<? super T> call(final Subscriber<? super List<T>> o) {

final List<T> list = new ArrayList<T>();

@Override
public void onStart() {
request(Long.MAX_VALUE);
}

@Override
public void onCompleted() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package rx.internal.operators;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
Expand Down Expand Up @@ -65,4 +66,10 @@ public Integer call(Integer t1, Integer t2) {
verify(observer, Mockito.never()).onError(any(Throwable.class));
verify(observer, times(1)).onCompleted();
}

@Test
public void testWithFollowingFirst() {
Observable<Integer> o = Observable.from(1, 3, 2, 5, 4);
assertEquals(Arrays.asList(1, 2, 3, 4, 5), o.toSortedList().toBlocking().first());
}
}

0 comments on commit 077d70a

Please sign in to comment.