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
2024-10-02 dev2next - Application Observability like you've never heard before
jonatan_ivanov
0
180
型付きで行うVSCode拡張機能開発 / VSCode Meetup #31
mazrean
0
240
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
410
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
11
1.5k
Vue :: Better Testing 2024
up1
1
410
Програмиране с Rust, ФМИ, 2024
nikolads
0
110
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
220
フロントエンドの現在地とこれから
koba04
10
4.6k
実践Dash - 手を抜きながら本気で作るデータApplicationの基本と応用 / Dash for Python and Baseball
shinyorke
2
610
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
520
[KR] Server Driven Compose With Firebase
skydoves
2
200
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
210
Featured
See All Featured
A designer walks into a library…
pauljervisheath
202
24k
Designing for humans not robots
tammielis
249
25k
Atom: Resistance is Futile
akmur
261
25k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.7k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.9k
It's Worth the Effort
3n
183
27k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Infographics Made Easy
chrislema
239
18k
Docker and Python
trallard
40
3k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Faster Mobile Websites
deanohume
304
30k
Producing Creativity
orderedlist
PRO
341
39k
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