11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RxJava2 めも(Single, Complete, Maybe, Observable, Flowable, Subject, Processor)

Last updated at Posted at 2018-12-22

Single, Complete, Maybe, Observableの使い分け

名前 説明 使えるメソッド
Single 値1つ onSuccess(a: Any)/ onError(e: Throwable)
Complete 値なし onComplete()/ onEroor(e: Throwable)
Maybe 値1つor 値なし onSuccess(a: Any)/ onError(e: Throwable)/ onComplete()
Observable 値たくさん onNext(a: Any)/ onError(e: Throwable)/ onComplete()

Observable, Flowable, Subject, Processor使い分け

BackPressureなし BackPressureあり
-able; 購読される  Observable Flowable
-er; 購読する  Observer Observer
-erであり、-ableでもある; 購読することも、されることもできる Subject Processor

FlowableはObservableの進化系。
Flowableは、BackPressureなるものを調整して、onNestででてくるデータのスピード調整などができる。

Subect, Processorは、それぞれObservable, Flowableの進化系。
subscribeすることもできるし、subscriberとしてobserveすることもできる。

参考文献

11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?