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
0
110
Tyrannosaurus Rx
Basic overview of Rx (Reactive Extensions)
James Hughes
September 03, 2014
Tweet
Share
More Decks by James Hughes
See All by James Hughes
Functional Programming with Clojure
kouphax
1
110
React
kouphax
2
700
Play for (Java|Scala)
kouphax
0
110
Devops: A Case Study
kouphax
0
67
Scala for C# Developers
kouphax
5
2.6k
Dropwizard - Production Ready Web Services
kouphax
3
1.5k
Scala for Fun & Profit
kouphax
4
610
What Agile Means To Me
kouphax
0
120
Neo4J: A Case Study
kouphax
3
610
Other Decks in Programming
See All in Programming
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
150
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
290
ErdMap: Thinking about a map for Rails applications
makicamel
1
570
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
580
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
0
130
為你自己學 Python
eddie
0
510
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Language of Interfaces
destraynor
155
24k
Typedesign – Prime Four
hannesfritz
40
2.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Embracing the Ebb and Flow
colly
84
4.5k
Become a Pro
speakerdeck
PRO
26
5.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Fireside Chat
paigeccino
34
3.1k
KATA
mclloyd
29
14k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
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