4
我知道由於缺乏背壓支持,使用Observable.create
is discouraged in RxJava。由於這個原因,我已經開始使用新的Observable.fromAsync
來包裝回調API,因爲它處理背壓的方式看起來與Observable.create
的行爲看似相同。RxJava中的Observable.create vs Observable.fromAsync
但是在these draft docs,建議似乎是揭我的創建觀察到類似下面應該解決這個問題:
Observable<T> observable = Observable.create(onSubscribe).onBackpressureBuffer();
這是正確的嗎?在這點上兩個操作員有什麼區別?如果這不正確,是否有任何理由使用.create
而不是.fromAsync
?
明白了 - 所以一般情況下,忘記「創建」存在。謝謝! – Marcus
順便說一句 - 這些新鏈接的文檔非常出色!讓他們公開,快! – Marcus
@Marcus它是公共的http://stackoverflow.com/documentation – LordRaydenMK