SlideShare a Scribd company logo
1 of 19
Download to read offline
T O M A S Z K O W A L C Z E W S K I
Agenda
• A little bit of history
• Challenges before us
• A few words about API
• Code!
Reactive, asynchronous
• People have been doing it for years
• (Re)invented time and again by big companies
and/or in high performance products
–Donald Knuth
“The idea that people knew a thing or two in the
70s is strange to a lot of young programmers”
Reactive, asynchronous
• People have been doing it for years
• (Re)invented time and again by big companies
and/or in high performance products
• Now every company may need to operate at that
scale
• As users demand more and faster we need tools to
do it right
It started in Microsoft
Brought to you by Erik Meijer & co.
Synchronous pull communication
Client Server
Request
Response
Processing
Network latency
Asynchronous push
Processing
Network latency
Asynchronous push
t
subscribe
onNext*
onCompleted | onError
unsubscribe
Synchronous design
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
Decomposing individual operations
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
Decomposing individual operations
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
Decomposing individual operations
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
Decomposing individual operations
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
What is missing?
List<String> tweets = client.getNextTweets();
List<Tweet> validTweets = Lists.newArrayList();
for (String jsonTweet : tweets) {

Tweet tweet = gson.fromJson(jsonTweet, Tweet.class);
Image image;
image = download(tweet.getUser().getProfileImage());
Tweet.setImage(image);


if (tweet.isValidTweet()) {
validTweets.add(tweet);
}
}
Error
handling
Timeouts
Monitoring
Logging
Back pressure
Parallelism
Available in a language or

framework near you
source: flatmapthatshit.com
Credits
• Cat picture taken from http://www.teckler.com/en/
Rapunzel

More Related Content

Viewers also liked (10)

Feria de reciclaje
Feria de reciclajeFeria de reciclaje
Feria de reciclaje
 
Fluidisasi
FluidisasiFluidisasi
Fluidisasi
 
Duck dynasty - My family
Duck dynasty - My familyDuck dynasty - My family
Duck dynasty - My family
 
히포차트4.1업데이트
히포차트4.1업데이트히포차트4.1업데이트
히포차트4.1업데이트
 
Learning@Work Product Tour
Learning@Work Product TourLearning@Work Product Tour
Learning@Work Product Tour
 
Mano miestas mycka
Mano miestas myckaMano miestas mycka
Mano miestas mycka
 
Underneath the Roses Where I Remembered Everything by Molly Rose
Underneath the Roses Where I Remembered Everything by Molly RoseUnderneath the Roses Where I Remembered Everything by Molly Rose
Underneath the Roses Where I Remembered Everything by Molly Rose
 
Dna 2
Dna 2Dna 2
Dna 2
 
Power point group project luis alvarez
Power point group project luis alvarezPower point group project luis alvarez
Power point group project luis alvarez
 
Presentazione openBilanci
Presentazione openBilanciPresentazione openBilanci
Presentazione openBilanci
 

Similar to Deep dive reactive java (DevoxxPl)

Similar to Deep dive reactive java (DevoxxPl) (20)

JDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz KowalczewskiJDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
 
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
 
Re-architecting the designer-developer workflow
Re-architecting the designer-developer workflowRe-architecting the designer-developer workflow
Re-architecting the designer-developer workflow
 
Getting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time Analytics
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
 
Getting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time Analytics
 
PyTorch 튜토리얼 (Touch to PyTorch)
PyTorch 튜토리얼 (Touch to PyTorch)PyTorch 튜토리얼 (Touch to PyTorch)
PyTorch 튜토리얼 (Touch to PyTorch)
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
 
Moderne App-Architektur mit Dagger2 und RxJava
Moderne App-Architektur mit Dagger2 und RxJavaModerne App-Architektur mit Dagger2 und RxJava
Moderne App-Architektur mit Dagger2 und RxJava
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
TSAR (TimeSeries AggregatoR) Tech Talk
TSAR (TimeSeries AggregatoR) Tech TalkTSAR (TimeSeries AggregatoR) Tech Talk
TSAR (TimeSeries AggregatoR) Tech Talk
 
Tsar tech talk
Tsar tech talkTsar tech talk
Tsar tech talk
 
Who needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, ColuWho needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, Colu
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Unleashing Twitter Data for Fun and Insight
Unleashing Twitter Data for Fun and InsightUnleashing Twitter Data for Fun and Insight
Unleashing Twitter Data for Fun and Insight
 
Unleashing twitter data for fun and insight
Unleashing twitter data for fun and insightUnleashing twitter data for fun and insight
Unleashing twitter data for fun and insight
 
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
 
Fast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDBFast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDB
 
react-suspense-for-people-in-hurry
react-suspense-for-people-in-hurryreact-suspense-for-people-in-hurry
react-suspense-for-people-in-hurry
 
Introduction to Reactive Extensions (Rx)
Introduction to Reactive Extensions (Rx)Introduction to Reactive Extensions (Rx)
Introduction to Reactive Extensions (Rx)
 

More from Tomasz Kowalczewski

More from Tomasz Kowalczewski (11)

How I learned to stop worrying and love the dark silicon apocalypse.pdf
How I learned to stop worrying and love the dark silicon apocalypse.pdfHow I learned to stop worrying and love the dark silicon apocalypse.pdf
How I learned to stop worrying and love the dark silicon apocalypse.pdf
 
Is writing performant code too expensive?
Is writing performant code too expensive? Is writing performant code too expensive?
Is writing performant code too expensive?
 
Is writing performant code too expensive?
Is writing performant code too expensive? Is writing performant code too expensive?
Is writing performant code too expensive?
 
Is writing performant code too expensive?
Is writing performant code too expensive?Is writing performant code too expensive?
Is writing performant code too expensive?
 
Everybody Lies
Everybody LiesEverybody Lies
Everybody Lies
 
Forgive me for i have allocated
Forgive me for i have allocatedForgive me for i have allocated
Forgive me for i have allocated
 
Reactive Java at JDD 2014
Reactive Java at JDD 2014Reactive Java at JDD 2014
Reactive Java at JDD 2014
 
Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)
 
Introduction to Reactive Java
Introduction to Reactive JavaIntroduction to Reactive Java
Introduction to Reactive Java
 
Java 8 jest tuż za rogiem
Java 8 jest tuż za rogiemJava 8 jest tuż za rogiem
Java 8 jest tuż za rogiem
 
Java gets a closure
Java gets a closureJava gets a closure
Java gets a closure
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

Deep dive reactive java (DevoxxPl)

  • 1. T O M A S Z K O W A L C Z E W S K I
  • 2. Agenda • A little bit of history • Challenges before us • A few words about API • Code!
  • 3. Reactive, asynchronous • People have been doing it for years • (Re)invented time and again by big companies and/or in high performance products –Donald Knuth “The idea that people knew a thing or two in the 70s is strange to a lot of young programmers”
  • 4. Reactive, asynchronous • People have been doing it for years • (Re)invented time and again by big companies and/or in high performance products • Now every company may need to operate at that scale • As users demand more and faster we need tools to do it right
  • 5. It started in Microsoft
  • 6. Brought to you by Erik Meijer & co.
  • 7. Synchronous pull communication Client Server Request Response Processing Network latency
  • 10. Synchronous design List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } }
  • 11. Decomposing individual operations List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } }
  • 12. Decomposing individual operations List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } }
  • 13. Decomposing individual operations List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } }
  • 14. Decomposing individual operations List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } }
  • 15. What is missing? List<String> tweets = client.getNextTweets(); List<Tweet> validTweets = Lists.newArrayList(); for (String jsonTweet : tweets) {
 Tweet tweet = gson.fromJson(jsonTweet, Tweet.class); Image image; image = download(tweet.getUser().getProfileImage()); Tweet.setImage(image); 
 if (tweet.isValidTweet()) { validTweets.add(tweet); } } Error handling Timeouts Monitoring Logging Back pressure Parallelism
  • 16.
  • 17. Available in a language or
 framework near you
  • 19. Credits • Cat picture taken from http://www.teckler.com/en/ Rapunzel