Flowable<String> delay = Flowable.just("") .switchMap(dummy -> Flowable.timer(randomTime(), TimeUnit.SECONDS)) .map( a -> String.valueOf(a) ) .repeat(); Flowable<String> messages = Flowable.just("Test") //eventually lines from a file... .repeat(); delay.zipWith(messages, (d, msg) -> ""+d+" "+msg ).subscribe( System.out::println );
setDisposable. The behavior then is provided by the Emitter. I don't see any case for misleading naming, just misunderstanding. The main use case for
setCancellableis to release resources created within the emitter callback which are scoped for the duration of the emission. If you have external resources that are shared, you'll need other means to release them considering how a solution would interact with it.