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
Tyrannosaurus Rx
Search
James Hughes
September 03, 2014
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tyrannosaurus Rx
Basic overview of Rx (Reactive Extensions)
James Hughes
September 03, 2014
More Decks by James Hughes
See All by James Hughes
Functional Programming with Clojure
kouphax
1
160
React
kouphax
2
750
Play for (Java|Scala)
kouphax
0
160
Devops: A Case Study
kouphax
0
110
Scala for C# Developers
kouphax
5
2.7k
Dropwizard - Production Ready Web Services
kouphax
3
1.7k
Scala for Fun & Profit
kouphax
4
670
What Agile Means To Me
kouphax
0
180
Neo4J: A Case Study
kouphax
3
700
Other Decks in Programming
See All in Programming
プロポーザルを書いてもらう
pvcresin
0
280
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
150
React本体のコードリーディング
high_g_engineer
1
140
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
530
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
170
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
テーブルをDELETEした
yuzneri
0
140
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
760
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
120
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Color Theory Basics | Prateek | Gurzu
gurzu
0
410
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
360
First, design no harm
axbom
PRO
2
1.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
HDC tutorial
michielstock
2
780
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
490
Transcript
TYRANNOSAURUS RX
REACTIVE EXTENSIONS
None
Java JS C# Clojure Groovy Scala Kotlin Python Ruby C++
Haskell
var list = [1,2,3,4,5,6,7]; ! for(var i = 0; i
< list.length; i++) { console.log(list[i]) }
var list = [1,2,3,4,5,6,7]; ! list.forEach(function(item) { console.log(item) })
var list = [Promise(), Promise()…]; ! list.forEach(function(item) { console.log(item.get()) })
TIME RUINS EVERYTHING
None
None
None
OBSERVABLES LISTS WITH TIME REIFIED EVENT STREAM PUSH BASED
CREATING OBSERVABLES ITERABLE FUTURE/PROMISE EVENTS RULES OBSERVABLE
CREATING OBSERVABLES Observable.from(new String[] { "The Joker", "The Riddler", "Penguin",
"Catwoman"})
CREATING OBSERVABLES baddies.subscribe((baddie) -> { out.println(baddie + “ is bad.”)
})
CREATING OBSERVABLES The Joker is bad. The Riddler is bad.
Penguin is bad. Catwoman is bad.
CREATING OBSERVABLES class _ extends Subscriber<String> { void onCompleted() {}
void onError(Throwable t) {} void onNext(String s){} }
CREATING OBSERVABLES onNext("The Joker”)
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”)
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin")
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin") onNext(“Catwoman")
CREATING OBSERVABLES onCompleted() onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin") onNext(“Catwoman")
ERROR HANDLING onNext("The Joker”)
onNext("The Joker”) onNext("The Riddler”) ERROR HANDLING
X onNext("The Joker”) onNext("The Riddler”) ERROR HANDLING
X onNext("The Joker”) onNext("The Riddler”) onError(ex) ERROR HANDLING
TRANSFORMING OBSERVABLES TURN AN OBSERVABLE OF ONE TYPE INTO ANOTHER
TRANSFORMING OBSERVABLES Observable ints = Observable .interval(1, SECONDS); ! ints.map((i)
-> i + 1) .map((i) -> i + “ seconds”) .subscribe(out::println)
TRANSFORMING OBSERVABLES map map
TRANSFORMING OBSERVABLES 1 seconds 2 seconds 3 seconds 4 seconds
...
TRANSFORMING OBSERVABLES flatMap(), groupBy(), buffer(), window()
FILTERING OBSERVABLES SELECT AND REJECT ITEMS EMITTED BY AN OBSERVABLE
FILTERING OBSERVABLES var keys = Rx.DOM.keypress(el) var ints = keys.filter(isNumeric)
! ints.subscribe(console.log)
FILTERING OBSERVABLES filter X X
FILTERING OBSERVABLES distinct(), timeout(), ignoreElements(), throttleFirst(), debounce(), sample(), first(), last(),
take(), skip()
COMBINING OBSERVABLES COMPOSING MULTIPLE OBSERVABLES INTO A SINGLE OBSERVABLE
COMBINING OBSERVABLES Observable goodies = Observable.from( new String[]{ "Batman", "Robin",
"Alfred", “Batgirl"}); ! goodies.zipWith(baddies, (g,b) -> g + " punches " + b)
COMBINING OBSERVABLES zipWith
COMBINING OBSERVABLES Batman punches The Joker Robin punches The Riddler
Alfred punches Penguin Batgirl punches Catwoman
STUFF AND OTHER THINGS retry(), delay(), timestamp(), amb(), defaultIfEmpty(), reduce(),
count()
None
TYRANNOSAURUS RX