Answer the question
In order to leave comments, you need to log in
How to work with multithreading in MVP?
Understanding the MVP pattern, I can’t figure out how to make an asynchronous request in the repository if the repository in MVP should not know about the presenter.
Answer the question
In order to leave comments, you need to log in
For example, use RxJava, then the repository returns an Observable and it doesn't matter who is subscribed to it.
Another option is to use callbacks. The presenter, addressing the repository, releases the callback interface to receive the data. In this case, the repository again does not know who is accessing it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question