These are chat archives for ReactiveX/RxJava

6th
Sep 2016
AriMeidan
@MeidanAri_twitter
Sep 06 2016 12:49
Hi, Can I ask a question?
Юрий Ярош
@yuriy-yarosh
Sep 06 2016 20:34
@MeidanAri_twitter sure, why not ?
But I think it's better to check SO first.
@benjchristensen RxJava2 new Flowable+Observable API is so frustrating.
IMHO mixing it all up might end up as a massive abstraction leakage.
I think both reactive-streams and rxjava API's should be separated via some kind of a bridge without additional duplication of all the operators and main interfaces... doing the same, except they all had been renamed all over the place - it makes hell a lot of frustration. And the bridging itself should be completely optional and not a built in feature...
David Karnok
@akarnokd
Sep 06 2016 21:48
If Java had extension methods like Kotlin or C# then I'd agree and we'd have all these types in their own libraries with bridges between them. Unfortunately Java does not have extension methods and so far, any lack of fluent conversion methods (toSingle, etc.) caused more pain than having 3-4-5 base reactive types. Generally, you'd want to use Observable for GUI eventing or less than 1000 element sequences; Flowable for interop and millions of elements; Singlefor exactly one element sources and transformations, Completable for async side-effects and Maybe for optional single values.
Dorus
@Dorus
Sep 06 2016 21:48
@akarnokd Instead of extension methods, you can use .compose(myMethod) right?
Юрий Ярош
@yuriy-yarosh
Sep 06 2016 21:48
btw @akarnokd thnx for the Maybe :+1:
Dorus
@Dorus
Sep 06 2016 21:51
nevermind, compose wont work when you want to transform from an Observable to something else.
Юрий Ярош
@yuriy-yarosh
Sep 06 2016 21:51
there's .toFlowable()
I think I should try to stick with new terminology, and whole this new Post Java8 abstractions ... and then maybe it'll make some sense after a while.
David Karnok
@akarnokd
Sep 06 2016 21:56
There is to(Function<Flowable<T>, R>) and similar in each base type. However, nobody seem to like flowable.to(SingleConverter::from) and such.
Also Maybe not my idea, Project Reactor has Mono for that and you can convert between RxJava 2 and Reactor (as both support Reactive-Streams in some types).
Юрий Ярош
@yuriy-yarosh
Sep 06 2016 22:00
I'm just thanking for the last few Maybe commits into 2.x branch ...