These are chat archives for ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
obs = geoCaches.share(); withMap = obs.filter(c -> c.withStaticMap()).buffer(5); withoutMap = obs.filter(c -> c.withoutStaticMap()).buffer(); result = withMap.mergeWith(withoutMap);
Something like this ?
mergeWith. In Akka streams, there is an explicit
mergePreferredwhich favours one entry over the others.
mergeWithwill subscribe sequentially I think. So I will first emit items from withMap.
mergePreferredin Akka streams: http://doc.akka.io/docs/akka/2.4.2/scala/stream/stages-overview.html#mergepreferred
prefered.mergeWith(other)will (defacto) emit items from
preferedas it be subscribed first. It should be pretty closed to your description ? (but the
mergefrom Akka can't be done out of the box with Rx, I think, as Rx don't do random subscription order)
preferredmight require a long time to generate in full if many geocaches do not fit the criterium. So the network downloader (the subscriber) will have to wait, while it could in the meantime download some non-preferred geocaches that we have encountered when going through the list of geocaches.