I play RXJava, modify Android. I am trying to do the following:
I need to periodically interrogate the call that will give me Observable> (From here I could do this)
As soon as I get this list, I want to iterate through each delivery and call the other methods that will give me ETA (so just more information). I want to add this new information to the delivery and return a complete list with additional information attached to each item.
I know how to do this without rxjava as soon as I get the list, but I would like to practice.
This is my code:
pollDeliveries = Observable.interval(POLLING_INTERVAL, TimeUnit.SECONDS, Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR)) .map(tick -> RestClient.getInstance().getApiService().getDeliveries()) .doOnError(err -> Log.e("MPB", "Error retrieving messages" + err)) .retry() .subscribe(deliveries -> { MainApp.getEventBus().postSticky(deliveries); });
This gives me a list of supplies. Now I would like to complete the second part.
I hope I was clear enough. Thanks
source share