These are chat archives for ReactiveX/RxJava

23rd
Jan 2018
mreddimasi
@mreddimasi
Jan 23 2018 07:05

Hi,
Was wondering if the community could help me on how I could parallelize the 3 calls shown in the code below?

Observable<CheckoutDetailsDTO> o = Observable.zip(
            orderIntegrationService.getRxOrderByOrderId(orderId),
            shippingIntegrationService.getRxAddressListForUser(),
            paymentIntegrationService.getRxPaymentInfoForUser(),
            (order, addresslist, paymntinfo) ->  new CheckoutDetailsDTO(order, addresslist, paymntinfo));

The calls to order, shipping and payment happen to be called one after another in the code above, is there any way it can be parallelized as the 3 calls are independent of each other ?

mreddimasi
@mreddimasi
Jan 23 2018 07:38
I've tried the following to parallelize, but still see that its been called one after another
orderIntegrationService.getRxOrderByOrderId(orderId).subscribeOn(Schedulers.io()),
            shippingIntegrationService.getRxAddressListForUser().subscribeOn(Schedulers.io()),
            paymentIntegrationService.getRxPaymentInfoForUser().subscribeOn(Schedulers.io()),