1

使用 rxscala,我们可以像这样订阅 observables:

val stream = Observable.just(1, 2, 3)

stream.subscribe(x => doSomething(x))
stream.subscribe(x => doSomething(x))
stream.subscribe(x => doSomething(x))
stream.subscribe(x => doSomething(x))

是否可以从侧面取消订阅所有观察者(有 4 个)stream

4

0 回答 0