Skip to content

Commit 077d70a

Browse files
committed
Merge pull request #1474 from mattrjacobs/ignore-backpressure-operator-tosortedlist
Ignore backpressure for OperatorToObservableSortedList
2 parents 52c6ca0 + 160a758 commit 077d70a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

rxjava-core/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public Subscriber<? super T> call(final Subscriber<? super List<T>> o) {
5252

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

55+
@Override
56+
public void onStart() {
57+
request(Long.MAX_VALUE);
58+
}
59+
5560
@Override
5661
public void onCompleted() {
5762
try {

rxjava-core/src/test/java/rx/internal/operators/OperatorToObservableSortedListTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package rx.internal.operators;
1717

18+
import static org.junit.Assert.assertEquals;
1819
import static org.mockito.Matchers.any;
1920
import static org.mockito.Mockito.mock;
2021
import static org.mockito.Mockito.times;
@@ -65,4 +66,10 @@ public Integer call(Integer t1, Integer t2) {
6566
verify(observer, Mockito.never()).onError(any(Throwable.class));
6667
verify(observer, times(1)).onCompleted();
6768
}
69+
70+
@Test
71+
public void testWithFollowingFirst() {
72+
Observable<Integer> o = Observable.from(1, 3, 2, 5, 4);
73+
assertEquals(Arrays.asList(1, 2, 3, 4, 5), o.toSortedList().toBlocking().first());
74+
}
6875
}

0 commit comments

Comments
 (0)