File tree 1 file changed +7
-4
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -223,13 +223,16 @@ trait Observable[+T]
223
223
* push results into the specified subject.
224
224
*
225
225
* @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.
227
227
* @return a pair of a start function and an [[rx.lang.scala.Observable ]] such that when the start function
228
228
* is called, the Observable starts to push results into the specified Subject
229
229
*/
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))
233
236
}
234
237
235
238
/**
You can’t perform that action at this time.
0 commit comments