-
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
Add replay
and multicast
variants to RxScala
#1160
Conversation
RxJava-pull-requests #1072 SUCCESS |
I'd like someone with better Scala skills that me to review this please. |
I'll code review it later today, but in principle these are simple fixes to bring the other variants of publish in sync with returning connectable observable. |
shared.subscribe(n => println(s"subscriber 1 gets $n")) | ||
shared.subscribe(n => println(s"subscriber 2 gets $n")) | ||
shared.connect | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example does not really enlighten users on what multicast is good for, because they just see the same output as if they hadn't used it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this example from exampleWithPublish
since publish = multicast(Subject())
.
@Test def exampleWithPublish() {
val unshared = Observable.from(1 to 4)
val shared = unshared.publish
shared.subscribe(n => println(s"subscriber 1 gets $n"))
shared.subscribe(n => println(s"subscriber 2 gets $n"))
shared.connect
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I got it, we can l leave it, because the output is different
Conflicts: language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala
RxJava-pull-requests #1081 SUCCESS |
Conflicts: language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala
RxJava-pull-requests #1087 SUCCESS |
Is this reviewed and ready to go? It is conflicting against master, so can you please rebase? |
Waiting until #1210 is merged. |
Conflicts: language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala language-adaptors/rxjava-scala/src/test/scala/rx/lang/scala/CompletenessTest.scala
Already merged |
RxJava-pull-requests #1129 SUCCESS |
Should this wait until we're ready to do 0.19? |
I think this one can be merged since #1188 has already broken the API. @headinthebox @samuelgruetter , do you mind it? |
Go for it. |
Add `replay` and `multicast` variants to RxScala
This PR has some breaking changes:
def multicast[R >: T](subject: rx.lang.scala.Subject[R]): (() => Subscription, Observable[R])
todef multicast[R >: T](subject: rx.lang.scala.Subject[R]): ConnectableObservable[R]
def replay: (() => Subscription, Observable[T])
todef replay: ConnectableObservable[T]
Observable.apply(Int)
So it's better to merge it at the next major release.
#1152, #1153.
/cc @headinthebox @samuelgruetter