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
590
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
140
Electron Pro-Tips
anaisbetts
0
210
Electron: The Boring Parts
anaisbetts
1
400
Why Akavache is Fast: How not to use sqlite3
anaisbetts
0
190
Native Modules in Electron
anaisbetts
3
8.4k
Single Page Apps in Electron
anaisbetts
3
1.5k
Functional Reactive Programming in Practice
anaisbetts
2
330
On Programming
anaisbetts
3
380
MVVM Without XAML
anaisbetts
3
700
Other Decks in Technology
See All in Technology
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
120
Identity Management for Agentic AI 解説
fujie
0
590
Microsoft Agent Frameworkの可観測性
tomokusaba
1
120
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
1.2k
Redshift認可、アップデートでどう変わった?
handy
1
110
AIエージェントを5分で一気におさらい!AIエージェント「構築」元年に備えよう
yakumo
1
120
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
2.6k
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
1
330
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
250
BidiAgent と Nova 2 Sonic から考える音声 AI について
yama3133
2
130
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
290
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
6
2.4k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
Ethics towards AI in product and experience design
skipperchong
1
140
Crafting Experiences
bethany
0
24
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.2k
Git: the NoSQL Database
bkeepers
PRO
432
66k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
0
33
The Cult of Friendly URLs
andyhume
79
6.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
From π to Pie charts
rasagy
0
97
How to train your dragon (web standard)
notwaldorf
97
6.5k
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!