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.
Flowable.reduceWith, but instead of immediate values, it would work with Singles... ie. where
Single<R>, I would like to give it
AtomicReference<R> accumulator = new AtomicReference<R>(initialR); source.concatMap(t -> function.apply(accumulator.get(), t) .doOnSuccess(r -> accumulator.set(r)) .toFlowable() ) .ignoreElements() .andThen(Flowable.fromCallable(() -> accumulator.get())) ;
generate, but where my
generatorfunction doesn't call
generate, but am getting some IllegalStateException's
I want a function with the signature
static Flowable<T> generate(T initialState, Function<T, Maybe<T>> generator)
Where the value of the
Maybe<T> is fed to generator to get the next value
Flowable.just(initialState).compose(FlowableTransformers.expand(s -> generator(s).toFlowable)).skip(1)
.skip(1)because I don't want to emit the
composelet's you apply operators without leaving the fluent style of specifying operators. It takes a transformer function that is called with the assembled stream that far and should return a new stream with added operators/behavior.
FlowableTransformers.expandemits the values of the original stream and for each value recursively calls the expand function to create more values until there is nothing to expand