黄舟2017-04-18 09:17:53
雷雷
RxJava 2 具有多个基类,您可以在以下位置发现运算符:
io.reactivex.Flowable
:0..N 个流,支持 Reactive-Streams 和背压io.reactivex.Flowable
: 0..N flows, supporting Reactive-Streams and backpressure
io.reactivex.Observable
: 0..N flows, no backpressure
io.reactivex.Single
: a flow of exactly 1 item or an error
io.reactivex.Completable
: a flow without items but only a completion or error signal
io.reactivex.Maybe
io.reactivex.Observable
:0..N 流,无背压
🎜🎜io.reactivex.Single
:恰好有 1 项的流程或错误🎜🎜
🎜🎜io.reactivex.Completable
:没有项目但只有完成或错误信号的流程🎜🎜
🎜🎜io.reactivex.Maybe
:没有项目、只有一个项目或错误的流程🎜🎜
🎜
🎜取消订阅可以尝试 RxLifecycle https://github.com/trello/RxL...,使用起来很方便。🎜