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
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.7k
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
初めてDefinitelyTypedにPRを出した話
syumai
0
420
距離関数を極める! / SESSIONS 2024
gam0022
0
290
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
CSC509 Lecture 11
javiergs
PRO
0
180
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
CSC509 Lecture 09
javiergs
PRO
0
140
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Building Applications with DynamoDB
mza
90
6.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Navigating Team Friction
lara
183
14k
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