Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Deep dive reactive java (DevoxxPl)

888 views

Published on

Slides part of Deep dive reactive java live coding session on DevoxxPL.

Published in: Software
  • Be the first to comment

Deep dive reactive java (DevoxxPl)

  1. 1. T O M A S Z K O W A L C Z E W S K I
  2. 2. Agenda • A little bit of history • Challenges before us • A few words about API • Code!
  3. 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. 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. 5. It started in Microsoft
  6. 6. Brought to you by Erik Meijer & co.
  7. 7. Synchronous pull communication Client Server Request Response Processing Network latency
  8. 8. Asynchronous push Processing Network latency
  9. 9. Asynchronous push t subscribe onNext* onCompleted | onError unsubscribe
  10. 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. 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. 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. 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. 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. 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. 16. Available in a language or
 framework near you
  17. 17. source: flatmapthatshit.com
  18. 18. Credits • Cat picture taken from http://www.teckler.com/en/ Rapunzel

×