Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RxJava: Which thread is running
Search
Samuel Huang
December 27, 2018
Programming
230
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RxJava: Which thread is running
Android Taipei - Lightning Talk
Samuel Huang
December 27, 2018
Transcript
11 slides
Private & Confidential RxJava: Which thread is running Samuel Huang
Private & Confidential 下載與處理資料的執行緒
Private & Confidential SubscribeOn
Private & Confidential ObserveOn
Private & Confidential taskSynchronizedObservable() .map(processData()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscribeOnNext());
Private & Confidential taskNetworkObservable() .map(processData()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscribeOnNext());
Private & Confidential SubscribeOn 指定 observable 工作的執行緒 但通知observer(onNext)的執行緒不一定相同
Private & Confidential private Observable<Void> taskNetworkObservable() { return Observable.create(emitter ->
{ runOnUiThread(() -> { emitter.onNext(null); emitter.onCompleted(); }); }, Emitter.BackpressureMode.NONE); }
Private & Confidential taskNetworkObservable() .subscribeOn(Schedulers.io()) .observeOn(Schedulers.io()) .map(processData()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscribeOnNext());
Private & Confidential 使用ObserveOn確保 observer(onNext)在特定執行緒呼叫
Private & Confidential Thank you
Other Decks in Programming
See All in Programming
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
220
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
300
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
200
Skills Are the New npm [AAIF Bengaluru, Nov 2026]
shivamsaraswat
0
130
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
500
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
160
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
130
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
430
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
840
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
820
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Facilitating Awesome Meetings
lara
57
7.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Ethics towards AI in product and experience design
skipperchong
2
470
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
1k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Skip the Path - Find Your Career Trail
mkilby
1
300
How to Talk to Developers About Accessibility
jct
2
630
ラッコキーワード サービス紹介資料
rakko
5
6M
Test your architecture with Archunit
thirion
2
2.5k