A
A
artshelom2018-08-08 11:33:49
Java
artshelom, 2018-08-08 11:33:49

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

1 answer(s)
D
Denis Zagaevsky, 2018-08-08
@artshelom

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 question

Ask a Question

731 491 924 answers to any question