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
Ana Betts
December 04, 2013
Technology
4
580
Awaiting for Rx
How to use Rx along with async/await, presented at NDC London
Ana Betts
December 04, 2013
Tweet
Share
More Decks by Ana Betts
See All by Ana Betts
Flutter in Practice
anaisbetts
2
130
Electron Pro-Tips
anaisbetts
0
190
Electron: The Boring Parts
anaisbetts
1
390
Why Akavache is Fast: How not to use sqlite3
anaisbetts
0
180
Native Modules in Electron
anaisbetts
3
8.4k
Single Page Apps in Electron
anaisbetts
3
1.5k
Functional Reactive Programming in Practice
anaisbetts
2
320
On Programming
anaisbetts
3
350
MVVM Without XAML
anaisbetts
3
680
Other Decks in Technology
See All in Technology
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
なぜCodeceptJSを選んだか
goataka
0
160
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
250
2024年にチャレンジしたことを振り返るぞ
mitchan
0
130
Featured
See All Featured
Six Lessons from altMBA
skipperchong
27
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
GraphQLとの向き合い方2022年版
quramy
44
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
How to Ace a Technical Interview
jacobian
276
23k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
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!