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

Add note about execution model for Observable.fromInputStream. #488

Merged
merged 5 commits into from Jan 11, 2018

Conversation

Projects
None yet
2 participants
@olafurpg
Contributor

olafurpg commented Dec 26, 2017

I was playing around with Observable.fromInputStream to read from
System.in and was struggling to understand why calling .subscribe()
blocked when using the default global scheduler. I expected the default
scheduler to block on one of its own threads leaving my program to
continue after .subscribe().

I have no idea how is best to explain this, feel free to close if you have a
better way to put it. Just wanted to send a PR since this took me a while to
figure out and thought it might be worth a mention in the otherwise fantastic docs.

PS. Thanks a lot for your amazing work, I am learning so much reading the Monix
sources and docs.

Add note about execution model for Observable.fromInputStream.
I was playing around with Observable.fromInputStream to read from
System.in and was struggling to understand why calling `.subscribe()`
blocked when using the default global scheduler. I expected the default
scheduler to block on one of its own threads leaving my program to
continue after `.subscribe()`.
@codecov

This comment has been minimized.

codecov bot commented Dec 26, 2017

Codecov Report

Merging #488 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           master   #488      +/-   ##
========================================
+ Coverage   89.99%    90%   +0.01%     
========================================
  Files         358    358              
  Lines        9338   9338              
  Branches     1792   1792              
========================================
+ Hits         8404   8405       +1     
+ Misses        934    933       -1
@alexandru

This comment has been minimized.

Member

alexandru commented Jan 9, 2018

Thanks @olafurpg — as a matter of policy the current preference is to not start with an automatic fork if not needed.

However you can trigger a fork by yourself:

Observable.fromInputStream(in).executeWithFork

alexandru added some commits Jan 11, 2018

@alexandru alexandru merged commit 59448e4 into monix:master Jan 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@olafurpg

This comment has been minimized.

Contributor

olafurpg commented Jan 12, 2018

Thank you @alexandru for clarifying the description! LGTM 👍

@olafurpg olafurpg deleted the olafurpg:blocksDefaultSchedulerDesc branch Jan 12, 2018

@alexandru alexandru added this to the 3.0.0 milestone Jan 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment