Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RxJava: Which thread is running
Search
Samuel Huang
December 27, 2018
Programming
1
230
RxJava: Which thread is running
Android Taipei - Lightning Talk
Samuel Huang
December 27, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
Oxlint JS plugins
kazupon
1
620
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
CSC307 Lecture 08
javiergs
PRO
0
670
Data-Centric Kaggle
isax1015
2
760
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
680
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
400
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
Leo the Paperboy
mayatellez
4
1.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Writing Fast Ruby
sferik
630
62k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
Building Applications with DynamoDB
mza
96
6.9k
We Have a Design System, Now What?
morganepeng
54
8k
Transcript
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