RxJava - 在链的顶部添加新的Observable

时间:2015-06-01 10:30:10

标签: rx-java

是否可以在已合并的Observable 之上添加新的Observable?或
每当我创建新的Observable时,我都必须构建一个新的Observable

假设我有一个合并的Observable喜欢

val trackable1: PublishSubject[JSONObject] = PublishSubject.create()
val flushable: PublishSubject[JSONObject] = PublishSubject.create()
val merged = flushable
              .mergedWith(trackable)
              .map(json -> {
                if (storage.size > 50)
                // send HTTP request
              });

val trackable2: PublishSubject[JSONObject] = PublishSubject.create()

// I would like to add trackable2 as the event source like trackable1
// without rebuilding the `merged` Observable.

感谢。

0 个答案:

没有答案