File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -223,13 +223,16 @@ trait Observable[+T]
223223 * push results into the specified subject.
224224 *
225225 * @param subject
226- * the `rx.lang.scala.subjects.Subject` to push source items into
226+ * the `rx.lang.scala.subjects.Subject` to push source items into. Note: this is a by-name parameter.
227227 * @return a pair of a start function and an [[rx.lang.scala.Observable ]] such that when the start function
228228 * is called, the Observable starts to push results into the specified Subject
229229 */
230- def multicast [R >: T ](subject : rx.lang.scala.Subject [R ]): ConnectableObservable [R ] = {
231- val s : rx.subjects.Subject [_ >: T , _< : R ] = subject.asJavaSubject
232- new ConnectableObservable [R ](asJavaObservable.multicast(s))
230+ def multicast [R >: T ](subject : => rx.lang.scala.Subject [R ]): ConnectableObservable [R ] = {
231+ val f = new rx.functions.Func0 [rx.subjects.Subject [_ >: R , _ <: R ]]() {
232+ override def call (): rx.subjects.Subject [_ >: R , _ <: R ] = subject.asJavaSubject
233+ }
234+ val thisJava : rx.Observable [_ <: R ] = asJavaObservable
235+ new ConnectableObservable [R ](thisJava.multicast[R ](f))
233236 }
234237
235238 /**
You can’t perform that action at this time.
0 commit comments