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
ナレッジグラフとLLMの相互利用
koujikozaki
0
420
Next.js のページ遷移を全力で止める
ypresto
7
3.3k
Envoy External AuthZとgRPC Extensionを利用した「頑張らない」Microservices認証認可基盤
andoshin11
0
250
効果的なオンコール対応と障害対応
ryuichi1208
6
3.1k
Cloud Run と GitHub Template Repository による軽量なアプリケーションプラットフォーム/ #nikkei_tech_talk
nikkei_engineer_recruiting
0
110
App Router を実プロダクトで採用して見えてきた勘所をちょっとだけ紹介
marokanatani
1
930
スタッフエンジニアの道: The Staff Engineer’s Path
snoozer05
PRO
44
14k
内製化を目指す事業会社が、システム開発会社と共に進める「開発生産性改善」の取り組み事例 #devsumi
yuwji
0
100
リアルお遍路+SORACOM IoT
ozk009
1
140
テスト”ケース”駆動開発 で手戻りをなくそう
ryohma0510
0
320
20240911_New_Relicダッシュボード活用例
speakerdeckfk
0
110
AIで変わるテスト自動化:最新ツールの多様なアプローチ/ 20240910 Takahiro Kaneyama
shift_evolve
0
240
Featured
See All Featured
Designing for humans not robots
tammielis
248
25k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
A better future with KSS
kneath
235
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
How to Think Like a Performance Engineer
csswizardry
16
960
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Designing with Data
zakiwarfel
98
5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
227
52k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Bash Introduction
62gerente
608
210k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
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!