Hello. Recently began to deal with RxJava. Something hard is still being given ... There is a server on which there are private chats (one-on-one) and group chats. Through the Rest request to the server, you need to extract the following information from there: All existing chats and dialogues:
Observable<List<Chat>> chats = apiService.getChats(); Observable<List<Dialog>> dialogs = apiService.getDialogs(); The Chat and Dialog objects contain variables:
int unreadMessagesCount (количество непрочитанных сообщений); int id (по этому id запрашивается список сообщений из чата) Requests for message list
Observable<List<Message>> dialogMessages = apiService.getDialogMessages(String id); Observable<List<Message>> chatMessages = apiService.getChatMessages(String id); How, in this case, is it more competent to create requests using RxJava to poll all chats and dialogues for new messages and then get these messages in one list?