I
I
i_cant_play_any_solo2021-08-01 20:07:08
Java
i_cant_play_any_solo, 2021-08-01 20:07:08

RXJava Retrofit how to combine two requests with different response length?

Hello!
I have a task:
From the server to get the name of the camera, the id of events from this camera, the URL of the image by the event ID
For example: we can have 5 cameras, 40 events in total from different cameras and 40 images
For API calls, I use RXJava and Retrofit
My the problem is that I am trying to combine the results of two Observables. One is obtained from the camera name server, the other is the event ID, but when trying to use .zip it does not work - as I understand it due to the different length of the response of the two Observables (from the example - 5 camera names and 40 IDs)
Can I combine the Observable in a similar way Or would it be more correct to store a separate list of camera names and then use this list to get event IDs for each name?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2021-08-02
@LukyanovPA

May help StartWith reactivex.io/documentation/operators/startwith.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question