SlideShare a Scribd company logo
Jan Carsten Lohmüller
I have a
stream
Insights in Reactive Programming
Jan Carsten
Lohmüller
@nachkonvention
WPS
Workplace Solutions GmbH
wps.de
@wps_de
Reactive, eh?
Reactive may refer to:
Generally, capable of having a reaction (disambiguation)
-Wikipedia
Reactive programming
is a programming paradigm ...
-Wikipedia
Procedural
Plankalkül
R1.1(V0[:sig]) => R0
R1.2(V0[:m x sig]) => R0
0 => i | m + 1 => j
[W [ i < j -> [ R1.1(V0[i: m x sig]) => R0 | i + 1 => i ] ] ]
END
R1.3() => R0
'H';'e';'l';'l';'o';',';' ';'w';'o';'r';'l';'d';'!' => Z0[: m x sig]
R1.2(Z0) => R0
END
Object
oriented
OOP to me means
only messaging, local retention and protection and hiding
of state-process , and extreme late binding of all things.
-Alan Kay
Architecture
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Functional
Purely functional
programming
is different. You don’t tell the computer what to do – you
tell him what stuff is.
-Miran Lipovaca
Math!
f = f = 1
f = f + f für n > 2
0 1
n n−1 n−2
In Haskell
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
Reactive
Excel
Reactive programming is
a programming paradigm oriented around data flows and
the propagation of change.
-Wikipedia
Reactive programming is
programming with
asynchronous data
streams.
-André Staltz
[ 1 , 2 , 3 , 4 , 5 , 8 , 13 ]
.filter(x -> x%2 == 0)
[ 2 , 4, 8 ]
Mouse events
x=200
y=50
→ x=689
y=324
→ x=195
y=142
→ x=982
y=897
→ x=87
y=964
→
BRACE
YOURSELVES...
.filter(c -> c.x < 200)
x=195
y=142
→ x=87
y=964
→ ...
Iterator
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Pull
Observer
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Push
http://reactivex.io
Observable
onNext()
onCompleted()
onError()
Subscription s = Observable.just( "Hello, world!")
.subscribe(new Subscriber<String>() {
@Override
public void onCompleted() {
// do sth
}
@Override
public void onError(Throwable e) {
// handle error stuff
}
@Override
public void onNext(String s) {
// next!
}
}
);
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Operators
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
DEMO
Manifesto
Message
Driven
Elastic
Resilient
Responsive
But how?
Michael Nygard
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Circuit
Breaker
Pattern
Circuit Breaker Example
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
.doOnError(e -> System.out.println( "Timeout!"))
.retry(4)
.onErrorReturn(e -> "Damn!")
.subscribe(sub);
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
.doOnError(e -> System.out.println( "Timeout!"))
// everytime the timeout is hit
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
.doOnError(e -> System.out.println( "Timeout!"))
.retry(4)
// please retry!
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
.doOnError(e -> System.out.println( "Timeout!"))
.retry(4)
.onErrorReturn(e -> "Damn!")
// failover...
Observable<String> query = db.rxExecuteLongRunningQuery();
query.timeout(2, TimeUnit.SECONDS, sched)
.doOnError(e -> System.out.println( "Timeout!"))
.retry(4)
.onErrorReturn(e -> "Damn!")
.subscribe(sub);
// and subscribe.
http://reactivex.io/languages.html
Java
JavaScript
C#
Scala
Clojure
Swift
C++
Ruby
Groovy
Python
JRuby
Kotlin
http://reactivex.io/tutorials.html
by André Staltz2 minute introduction to Rx
a video lecture by Erik MeijerA Playful Introduction to Rx
Version 2.x
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017
http://rxmarbles.com/
Wrap Up
Examples:
https://github.com/nachkonvention/rxjavasamples
Slides:
https://nachkonvention.github.io/rxcodemotion
Feedback!
@nachkonvention
Thank you!

More Related Content

PDF
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
PDF
Programming the cloud with Skywriting
PDF
[신경망기초]오류역전파알고리즘구현
PPT
Model-based GUI testing using UPPAAL
PDF
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
PDF
[신경망기초] 합성곱신경망
PDF
NTC_Tensor flow 深度學習快速上手班_Part1 -機器學習
PPTX
Bayesian workflow with PyMC3 and ArviZ
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
Programming the cloud with Skywriting
[신경망기초]오류역전파알고리즘구현
Model-based GUI testing using UPPAAL
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
[신경망기초] 합성곱신경망
NTC_Tensor flow 深度學習快速上手班_Part1 -機器學習
Bayesian workflow with PyMC3 and ArviZ

What's hot (13)

PPTX
Ee 3122 numerical methods and statistics sessional credit
PPTX
Erlang And ActorDB
PPTX
ATS Programming
PPT
Dynamic allocation
PDF
C++ TUTORIAL 8
PDF
C++ TUTORIAL 9
PDF
Exploring slides
PDF
Swift - Krzysztof Skarupa
PPTX
Bellman Ford Routing Algorithm-Computer Networks
PDF
5 1. character processing
DOCX
Assignement c++
PDF
13. dynamic allocation
PDF
Fragmentation
Ee 3122 numerical methods and statistics sessional credit
Erlang And ActorDB
ATS Programming
Dynamic allocation
C++ TUTORIAL 8
C++ TUTORIAL 9
Exploring slides
Swift - Krzysztof Skarupa
Bellman Ford Routing Algorithm-Computer Networks
5 1. character processing
Assignement c++
13. dynamic allocation
Fragmentation
Ad

Similar to I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017 (20)

PDF
BED-Con 2016 - I have a stream - Einsichten in Reactive Programming
PDF
Introducción a Elixir
PDF
OWASP PHPIDS talk slides
PPT
Georgy Nosenko - An introduction to the use SMT solvers for software security
PDF
python-2021.pdf
PDF
Python 1 liners
PDF
Reactive x
KEY
Erlang bootstrap course
PPT
Cpp tutorial
PDF
Python_Fundamentals_for_Everyone_Usefull
PDF
The Art Of Readable Code
PDF
Tales from a radically polyglot team
PPT
CppTutorial.ppt
PDF
Rxjs kyivjs 2015
PDF
stackconf 2022: Are all programming languages in english?
PDF
Fast, stable and scalable true radix sorting with Matt Dowle at useR! Aalborg
PDF
Being functional in PHP (PHPDay Italy 2016)
PPTX
Introduction to Neural Networks and Deep Learning from Scratch
PDF
rx.js make async programming simpler
PDF
WebCamp:Front-end Developers Day. Александр Мостовенко "Rx.js - делаем асинхр...
BED-Con 2016 - I have a stream - Einsichten in Reactive Programming
Introducción a Elixir
OWASP PHPIDS talk slides
Georgy Nosenko - An introduction to the use SMT solvers for software security
python-2021.pdf
Python 1 liners
Reactive x
Erlang bootstrap course
Cpp tutorial
Python_Fundamentals_for_Everyone_Usefull
The Art Of Readable Code
Tales from a radically polyglot team
CppTutorial.ppt
Rxjs kyivjs 2015
stackconf 2022: Are all programming languages in english?
Fast, stable and scalable true radix sorting with Matt Dowle at useR! Aalborg
Being functional in PHP (PHPDay Italy 2016)
Introduction to Neural Networks and Deep Learning from Scratch
rx.js make async programming simpler
WebCamp:Front-end Developers Day. Александр Мостовенко "Rx.js - делаем асинхр...
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Event Presentation Google Cloud Next Extended 2025
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PDF
DevOps & Developer Experience Summer BBQ
PDF
Google’s NotebookLM Unveils Video Overviews
PPTX
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
PDF
Doc9.....................................
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
madgavkar20181017ppt McKinsey Presentation.pdf
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Event Presentation Google Cloud Next Extended 2025
creating-agentic-ai-solutions-leveraging-aws.pdf
DevOps & Developer Experience Summer BBQ
Google’s NotebookLM Unveils Video Overviews
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
Doc9.....................................
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
NewMind AI Monthly Chronicles - July 2025
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Smarter Business Operations Powered by IoT Remote Monitoring
ChatGPT's Deck on The Enduring Legacy of Fax Machines
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - Codemotion Rome 2017