val observable = Observable(...)
.publish
val subscription = observable.connect
observable.doOnsubscribe(() => doSomething)
.subscribe()
The doSomething
is never called. The exact same code for RxJava was working properly. It seems for whatever reason it was never propagated to the underlying Java Observable
Update: So my workaround is
observable.asJavaObservable
.doOnSubscribe(new Action0 {
override def call(): Unit = {
doSomething
}
}}.asScala
.subscribe()