
Subject(링크) Subject는 데이터 발행과 구독을 한번에 할 수 있는 클래스입니다. onNext, onError, onComplete 함수로 데이터를 발행할 수 있으며, subscribe 함수로 데이터 구독을 할 수 있습니다. fun subject() { val subject = PublishSubject.create() subject.subscribe { println(it) } subject.onNext(1) subject.onError(Exception()) subject.onComplete() } AsyncSubject Subject에서 마지막으로 발행한 데이터만 받아옵니다. 완료되기 전 발행한 데이터는 무시합니다. 만약 오류가 발생하면 아무 값도 발행하지 않고 오류를 보냅니다. fun ..

Observable 데이터 소비와 상관없이 데이터를 계속 발행합니다. fun observableTest() { Observable.range(1, 10000) .doOnNext { println("emit : $it") } .observeOn(Schedulers.io()) .subscribe { Thread.sleep(100L) println("comsume : $it") } Thread.sleep(100000) } emit : 1 emit : 2 emit : 3 ... emit : 9998 emit : 9999 emit : 10000 comsume : 1 comsume : 2 comsume : 3 ... Flowable Flowable은 Observable과 다르게 Backpressure를 지원하며,..

Observable RxJava의 가장 핵심적인 요소입니다. Observable은 데이터를 흐름에 맞게 만들어서 Observer에게 보내는 역할을 합니다. RxJava는 이벤트를 통한 Observer Pattern을 기반으로 만들어졌습니다. Observable 가장 기본적인 형태, N개의 데이터를 발행할 수 있습니다. onComplete를 통해 완료를 알릴 수 있으며 onError를 통해 에러를 처리할 수 있습니다. onComplete, onError가 호출되면 이후에 발행하는 onNext는 무시합니다. fun observable() { Observable.create { emitter -> emitter.onNext(1) emitter.onNext(2) emitter.onNext(3) emitter.o..
- Total
- Today
- Yesterday
- Coroutine
- CancellationException
- ViewModelStoreOwner
- Widget
- 클린코드
- 연산자
- ViewModelProvider
- gradle
- Flutter
- Android
- 보이스카우트 규칙
- ConcatAdapter
- null
- TDD
- observable
- clean code
- DSL
- 함수
- 클린 코드
- 코루틴
- rxjava
- ConcatAdapter.Config
- Exception
- Flowable
- viewmodel
- DART
- git
- Kotlin
- commit
- isActive
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |