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

Long running operations are performed immediately in the caller thread #1

Closed
pilgr opened this issue Nov 24, 2015 · 4 comments
Closed

Comments

@pilgr
Copy link

pilgr commented Nov 24, 2015

As I see in the code
https://github.com/cesarferreira/RxPaper/blob/master/rxpaper/src/main/java/com/cesarferreira/rxpaper/RxPaper.java#L43
write is performed immediately as RxPaper.with(ctx).write(key, value) is called. This should be doing in onSuscribe instead so disk i/o could be postponed and scheduled in the bg thread using Rx.

@cesarferreira
Copy link
Owner

Hey @pilgr, great work on Paper! I've been using it for awhile and I love it 👍
Nice catch, I'm adressing this issue right now!

@pakoito
Copy link

pakoito commented Nov 25, 2015

Really important, even just using Observable.defer would be a cleaner fix than doing it onSubscribe.

@cesarferreira
Copy link
Owner

True @pakoito good point.
I guess it's ok now, thanks for the feedback!

@pakoito
Copy link

pakoito commented Nov 25, 2015

Check the comment I left on the commit!

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

No branches or pull requests

3 participants