-
Notifications
You must be signed in to change notification settings - Fork 111
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
RxJava 2+ support #227
Comments
I have privately done a tiny amount of exploration, but am not aware of any consolidated effort to provide a scala RxJava2 wrapper. |
I know very little about Scala but I managed to use RxJava 2 from it (Scala should be good at interoperation). The annoyances I've run into were the inability to use nice lambdas (in 2.11) and for many operators I had to specify the type parameters explicitly ( |
@akarnokd You can definitely make RxJava2 work directly but it requires additional boilerplate and isn't very scala idiomatic making it overal akward, a big minus especially considering there are some idiomatic alternatives (e.g. Akka Streams,Swave, Scalaz FS2/Stream) Some pain points/arguments for a wrapper would include:
|
...and also methods to create Observable from Scala Future, Try, Seq, etc. |
Hi, I've done quite a bit of work on this; but it's essentially a rewrite (adding proper co/contra variance, implicits for methods such as All of this is implemented as I'm unsure about the scope of this project and whether I should submit a PR, or put it in a different repo. EDIT: adding link |
Nice 😃 |
@samuelgruetter The best solution is to provide an implicit conversion within the I'm thinking of also adding compat in separate modules with The scope of the rewrite which I'm doing is,
|
This is going pretty well. I've been toying around with boilerplate generation since it was getting cumbersome to convert manually for the higher arity functions, esp those which are curried, as well as using SAM conversions depending on the scala version (important for pre 2.12). That's now done, so the conversions between all the function types are auto-generated as well as some nicer syntax to get the scala compiler to do most of the inference work (see I think the next part adding the rest of the functions should be pretty straight forward. |
This could work, but consider this example: If I have an
Yes, avoiding the dependency on scalaz and cats would be good, to have an adaptor which is as general and un-opinionated as possible.
I don't understand this, could you please elaborate?
👍
Testing is important, but there's no need to re-test RxJava.
Some reasons why it might not be straightforward are summarized in this comment 😉 Or, in other words, that's a list of things I'm unhappy about in the RxJava-1.0 based RxScala, it'd be great if you can avoid making these mistakes/find solutions. |
Thanks for the links. I've read through all of them and have got some ideas of how to solve them; I'll update the POC during the next few weeks while I play around with the syntax. For the second point, at some point when working with Java/Scala shops, one of the requirements was that any scala code could be called from java; which basically meant that you couldn't use any scala features like implicits etc... Also, I'm not suggesting to test rxjava; I'd hope that it's well tested 😜; more it's great to be able to use scalatest and specs2 with matchers specific to rxscala so you can do stuff like;
within your tests. |
Is there any way to make a |
Maybe you could use |
@samuelgruetter Not really sure how that would help - it doesn't seem to trampoline the function stack at all. The stack overflow is coming from the fact that
|
I've never used the trampoline scheduler myself, but I vaguely remember from a coursera course that it can be used to avoid recursion stackoverflow, and this link says so too. Did you try something like they suggest there? |
@samuelgruetter I see what you mean; I'd used it as a scheduler because I had assumed it would do something similar under the hood. I'll give it a go later this week. |
Hi guys, just wondering if there is there any movement on this? I am needing to make a decision on whether to move back to Java 1.x or wait until RxScala supports 2.x in a library, while I'm not in a super hurry, it'd be handy to know if we're looking at days/weeks/months before there's something mostly usable! |
Any progress on this? Is any help needed? |
@akarnokd I think it we could be make it a light wrapper around rxJava? |
@hepin1989 I don't know or use Scala, I have no idea how to do it. |
@akarnokd I know Scala and I do love RXJava too . |
This may be sacrilegious, but https://github.com/monix/monix is a pretty good Observable implementation written natively in Scala with support for Reactive Streams. ReactiveX is a fantastic library and I love would chip in to update it, if I had the time... |
@hudak So do I ,but I am currently busy on translation the Reactive Design Patterns book :(. |
Hi guys! While working with rxjava from scala, I've found that its api is pretty nice, but it doesn't mix well with scala - too much manual type signatures required. So I came up with a thin wrapper just to get rid of annoying typing. That simple wrappers work surprisingly well for our project, while not allow to use observables in for-comprehensions(why would you do it, anyway?), make using java api much less painful. The wrapper is far from being complete(I've wrapped only methods that our project requires). So, I'd say, that "lightweight wrappers" way should be considered, at least. Thanks. |
I'm the author of that library. I can help on RxScala for RxJava2 if needed. I use rxscala for RxJava1, but I would love to use RxJava2 if possible. |
I can also help, is there any repo for RxScala2? |
I tired https://github.com/monix/monix and it's excellent replacement for rxscala. Most api are same. Only problem - small community, and (according to my feelings) It may contain critical bugs |
I tried it too and it seems to be working great. What kind of bug is that? Have you reported it? |
Leaving this issue open in case anyone wants to work on a RxScala 3+ |
Hi,
Is there any plan for that?
I saw David had created a fork and started porting to RxJava 2.0.
Do you need any help? Is there any list of tasks to do?
I would like to help a little bit as far as I can ;).
The text was updated successfully, but these errors were encountered: