Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observe in main thread #40

Open
Aleks-Z opened this issue Aug 18, 2016 · 5 comments
Open

Observe in main thread #40

Aleks-Z opened this issue Aug 18, 2016 · 5 comments
Labels

Comments

@Aleks-Z
Copy link

Aleks-Z commented Aug 18, 2016

Why execute CheeseStorage in Main Thread ?

@DmitriyZaitsev
Copy link
Contributor

@Aleks-Z, I'm not sure I understand your question.
Could you please rephrase it and give more details?

@Aleks-Z
Copy link
Author

Aleks-Z commented Aug 18, 2016

Can i write in russia ?

@DmitriyZaitsev
Copy link
Contributor

@Aleks-Z, да.

@Aleks-Z
Copy link
Author

Aleks-Z commented Aug 18, 2016

image
В реализации Interactora явно указываются 2 Scheduler из RxJava. Один для Observable, другой для подписчика. В примере через Dagger дергаются Sheduler. Dagger получает Schedulers.computation(); для Observable в AppModule.java. Но я не могу понять почему у меня исполняется CheeseStorage в рабочем потоке а не в отдельном потоке.

@DmitriyZaitsev
Copy link
Contributor

@Aleks-Z,
Тело метода getCheeses() не выполняет никакой фоновой работы. Метод вызывается на UI-потоке, возращает Observable, на который уже оформляется подписка на указанном даггером шедуллере, а этот самый Observable уже в отдельном потоке делает работу и эмитит элементы.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants