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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
Foundation Models frameworkで画像分析
ryodeveloper
1
120
えっ!!コードを読まずに開発を!?
hananouchi
0
200
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
2
1.4k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
130
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
320
フィードバックで育てるAI開発
kotaminato
1
120
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
初めてのKubernetes 本番運用でハマった話
oku053
0
120
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
850
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6k
Creating Composable Callables in Contemporary C++
rollbear
0
210
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
370
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
Into the Great Unknown - MozCon
thekraken
41
2.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
The Limits of Empathy - UXLibs8
cassininazir
1
490
Utilizing Notion as your number one productivity tool
mfonobong
4
410
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
900
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
Facilitating Awesome Meetings
lara
57
7k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Building Applications with DynamoDB
mza
96
7.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
800
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