with concurrency=2 if first item is slow, second is fast, it doesn't start processing third item
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