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
Introduction to Reactive Extensions
Search
Ana Betts
March 10, 2012
Programming
3
680
Introduction to Reactive Extensions
This is a talk I first gave at Nebraska Code Camp on March 10th, 2012
Ana Betts
March 10, 2012
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
Awaiting for Rx
anaisbetts
4
580
On Programming
anaisbetts
3
350
Other Decks in Programming
See All in Programming
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
220
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
320
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
120
Learning Kotlin with detekt
inouehi
1
190
LINE messaging APIを使ってGoogleカレンダーと連携した予約ツールを作ってみた
takumakoike
0
130
もう少しテストを書きたいんじゃ〜 #phpstudy
o0h
PRO
20
4.3k
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
1.2k
PEPCは何を変えようとしていたのか
ken7253
3
300
楽しく向き合う例外対応
okutsu
0
730
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
300
ソフトウェアエンジニアの成長
masuda220
PRO
12
2.2k
Ça bouge du côté des animations CSS !
goetter
2
160
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
47
7.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
GitHub's CSS Performance
jonrohan
1030
460k
A Modern Web Designer's Workflow
chriscoyier
693
190k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Visualization
eitanlees
146
15k
Typedesign – Prime Four
hannesfritz
41
2.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
10
530
Scaling GitHub
holman
459
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Transcript
demo
REACTIVE EXTENSIONS
github @xpaulbettsx
We can no longer write synchronous software. - Abraham Lincoln
let’s talk linq.
the core of linq is the sequence.
pipelines new[] { 1, 2, 3, 4, 5 } .Select(x
=> x * 5) .Where(x => x % 2 == 0) .ForEach(Console.WriteLine)
a sequence is just some stuff, in a particular order
linq lets us describe what to do with data when
we get it... ...without actually having the data
what i’ve described is a monad.
I thought this was an Rx talk!
let’s talk events.
Events Aren’t Com pos able
OnMouseUp + OnMouseDown != OnDoubleClick
what is an event? OnKeyUp += (o,e) => DisplayASlide();
H
e
l
l
o
(!)
an event is just some stuff, in a particular order
Observables OnNext OnCompleted OnError ‘h’, ‘i’ no more stuff exception!
IObservable<T> IDisposable Subscribe(IObserver<T> observer); observable.Subscribe( x => WriteLine(x), () =>
WriteLine(“Done!”), ex => WriteLine(“Aieeeee!”));
IObservable is a list too
subscribe is your foreach
Cold <> Hot
Subject<T>
demo
Rx thinks about time
IObservable represents one of two things a stream of items
a future result
Rx Async Methods are methods that return IObservable<T>
IObservable<string> ReturnHelloWorld() { return Observable.Return(“Hello World”); } IObservable<string> ReturnHelloWorld() {
return Observable.Start(() => { return “Hello World”; }, Scheduler.TaskPoolScheduler); }
demo
learn more Rx Workshop Videos amzn.to/programming-rx