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
Other Decks in Programming
See All in Programming
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
420
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
ActionController meets Protocol Buffers
sorah
0
530
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Discover your Explorer Soul
emna__ayadi
2
1.3k
For a Future-Friendly Web
brad_frost
184
10k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Exploring anti-patterns in Rails
aemeredith
4
540
WCS-LA-2024
lcolladotor
0
890
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
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