Flowable.concatMapEagerDelayError doesn't work as expected (v2.2.6)

18 views
Skip to first unread message

Igor Zubchenok

unread,
Mar 19, 2019, 12:38:21 PM3/19/19
to RxJava
Hello

I use Flowable.concatMapEagerDelayError
with concurrency=2 if first item is slow, second is fast, it doesn't start processing third item 

How can I archive this?

Code:
long time = System.currentTimeMillis();
Flowable.just(10000L, 100L, 200L)
.concatMapEagerDelayError(i -> Flowable
.just(i)
.delay(i, TimeUnit.MILLISECONDS)
.doOnSubscribe(d -> System.out.println(System.currentTimeMillis() - time + "ms: subscribe " + i))
.doOnComplete(() -> System.out.println(System.currentTimeMillis() - time + "ms: complete " + i))
, 2
, 100
, true
)
.doOnNext(i -> System.out.println(System.currentTimeMillis() - time + "ms: fired " + i))
.blockingSubscribe();

Output:
146ms: subscribe 10000
148ms: subscribe 100
253ms: complete 100
10152ms: fired 10000
10152ms: complete 10000
10152ms: subscribe 200
10153ms: fired 100
10353ms: fired 200
10353ms: complete 200
Reply all
Reply to author
Forward
0 new messages