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
Awaiting for Rx
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ana Betts
December 04, 2013
Technology
590
4
Share
Awaiting for Rx
How to use Rx along with async/await, presented at NDC London
Ana Betts
December 04, 2013
More Decks by Ana Betts
See All by Ana Betts
Flutter in Practice
anaisbetts
2
160
Electron Pro-Tips
anaisbetts
0
210
Electron: The Boring Parts
anaisbetts
1
420
Why Akavache is Fast: How not to use sqlite3
anaisbetts
0
200
Native Modules in Electron
anaisbetts
3
8.4k
Single Page Apps in Electron
anaisbetts
3
1.5k
Functional Reactive Programming in Practice
anaisbetts
2
340
On Programming
anaisbetts
3
390
MVVM Without XAML
anaisbetts
3
720
Other Decks in Technology
See All in Technology
ARIA Notifyについて
ryokatsuse
1
120
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
Digitization部 紹介資料
sansan33
PRO
1
7.3k
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
2
580
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
370
みんなの「データ活用」を支えるストレージ担当から持ち込むAWS活用/コミュニティー設計TIPS 10選~「作れる」より、「続けられる」設計へ~
yoshiki0705
0
250
プラットフォームエンジニアリングの実践 - AWS コンテナサービスで構築する社内プラットフォーム / AWS Containers Platform Meetup #1
literalice
1
160
No Types Needed, Just Callable Method Check
dak2
1
1.2k
Hacobu Tech Deck
hacobu
PRO
0
110
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
320
QGISプラグイン CMChangeDetector
naokimuroki
1
400
AIでAIをテストする - 音声AIエージェントの品質保証戦略
morix1500
1
120
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
510
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Context Engineering - Making Every Token Count
addyosmani
9
830
Claude Code のすすめ
schroneko
67
220k
Design in an AI World
tapps
1
200
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
260
Optimizing for Happiness
mojombo
378
71k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
190
Transcript
Awaiting for Rx: ! A Play in Five Acts
/paulcbetts
Why Rx?
None
code is communication between people ! (that incidentally, also runs
on a computer)
await doesn’t help you get away from state
tasks don’t help you with events
Rx in 5 minutes
IObservable is a better event
None
events are lists
observable as timeline OnNext OnNext OnNext OnCompleted ‘A’ ‘B’ ‘C’
OnError!
tasks are just events that happen once
task as observable ‘A’ Task.Run(() => /*…*/)
None
+ Task<T>
you
can
await
IObservable
None
None
the catch
you must guarantee that the IObservable terminates
None
The two ways to make things awaitable: Take and Aggregate
None
someTask.ToObservable(); <=> someObservable.ToTask();
None
None
async-friendly Rx operators SelectMany Create Defer Switch IScheduler.Schedule StartAsync Using
Concat Merge
await often introduces unnecessary ordering constraints
None
None
this is MapReduce (or in C# lingo, SelectAggregate™)
None
always use Rx for UI events
always use Rx for UI events
ಠ_ಠ
always use Rx for UI events
None
None
describing an entire process in one place is the goal
None
describing an entire process in one place is the goal
Rx is particularly good at describing pipelines of data
declarative, functional code is easier to test
imperative await methods get the job done
None
None
None
use extensions to provide Task-friendly apis
None
None
– the average developer “hwæt.”
None
None
None
Rx makes testing eas(ier)
None
None
test ordering, not concurrency
None
None
Thanks!