-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Shorter naming for .toBlockingObservable() #1220
Comments
@benjchristensen wdyt? |
We specifically chose the explicit and long name You can however use The We could suggest to the broader group to alias something shorter like System.out.println(bucket.get("hello").blocking().single()); |
@benjchristensen makes sense! I really like |
+1 for Alias, |
@chrisjenx what do you think about just |
@daschl I think it needs to remain clear that its is to a blocking Observable, as |
@headinthebox @akarnokd @abersnaze @zsxwing Any issues with aliasing |
|
|
I submitted a (simple) PR for this in case we get consensus. |
I vote no, strongly. Autocomplete will type it for you. And as Ben says, it should be there as a blinking danger sign to war you that you are doing something unsafe. That why in Haskell unsafePerformIO has such a long name. If you want to make it shorter, I propose .BLOCKING(), all caps. |
@headinthebox not sure I can follow. While I can understand that it breaks the idea of async flows, lots of applications, sooner or later at the end of the chain will fall back to blocking so they can return it to a servlet or whatever. I don't think we should make it hard on people, sync programming is a legit concept, even if it is not as powerful as Rx. |
I also vote no. |
@daschl won this one :-) We have deprecated |
See #1233 for the change. |
@benjchristensen thanks for taking care of it. My users will appreciate it. |
Hi folks,
I'm exposing Observables to my user, and while this is awesome I'm realistic and know that a lot of them will fall back to blocking immediately either because they are migrating their blocking codebases or they just can't handle it properly.
While I think how RxJava exposes blocking is good, I think there is also room for improvement to make it shorter. For example, consider the following:
Especially if you are dealing a lot with just a single value, something like
await()
on the observable would be good, or some shorter way/alias name. To be honest I'm not sure if this is possible, but I also thought about shipping a helper class which just wraps the calls likeBlockingUtils(observable).single()
or something like this.The text was updated successfully, but these errors were encountered: