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

Implement shorter toBlocking as shorter alias for toBlockingObservable. #1224

Merged
merged 1 commit into from
May 20, 2014

Conversation

daschl
Copy link
Contributor

@daschl daschl commented May 20, 2014

Fixes #1220

@cloudbees-pull-request-builder

RxJava-pull-requests #1131 SUCCESS
This pull request looks good

@headinthebox
Copy link
Contributor

I s this really causing you pain? Autocomplete will type the few extra characters for you, when reading code toBlockingObservable should stand out like a sore thumb. DANGER.

@daschl
Copy link
Contributor Author

daschl commented May 20, 2014

@headinthebox actually not for me, but for our users. 99% of them are on blocking-type applications and will need to call that often. Even in unit tests it is very long and doesn't help with readability.

So I'm all in for a shorter version.

@benjchristensen
Copy link
Member

I think .toBlocking() still sufficiently signals what is going on. We don't need the Observable name everywhere, people already know it's an Observable.

Also, this is more similar to how we will likely someday implement .toParallel() which would return a ParallelObservable.

@headinthebox
Copy link
Contributor

I wont block this ;-). Just want to make sure people understand that blocking defeats the purpose of Rx.

@benjchristensen
Copy link
Member

Yes it certainly does ... but what I've found is that enabling an API with Rx is made far easier when we can give people who aren't ready to adopt async an easy way out. An API can always go from async to sync, but not sync to async, so anything that removes roadblocks to getting async APIs in place is helpful.

@benjchristensen
Copy link
Member

I kind of wish we didn't have toBlockingObservable after this change, but that's a massive breaking changes for a lot of codebases, so I think we'll just live with the alias.

benjchristensen added a commit that referenced this pull request May 20, 2014
Implement shorter toBlocking as shorter alias for toBlockingObservable.
@benjchristensen benjchristensen merged commit 3528e6a into ReactiveX:master May 20, 2014
@benjchristensen
Copy link
Member

Should we deprecate toBlockingObservable and delete in a release or two or keep them both forever?

@headinthebox
Copy link
Contributor

I guess so; too many aliases indicate indecisiveness of the API designers ;-)

@benjchristensen
Copy link
Member

Exactly.

benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request May 20, 2014
@benjchristensen
Copy link
Member

Done in #1233

@benjchristensen benjchristensen mentioned this pull request Jun 1, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants