Parallel and Asynchronous Programming with Streams and CompletableFuture with Venkat Subramaniam

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • Please subscribe to our RUclips channel @ bit.ly/devoxx-...
    Like us on Facebook @ / devoxxcom
    Follow us on Twitter @ / devoxx
    Java 8 makes it relatively easy to program with parallel streams and to implement asynchronous tasks using CompletableFuture. When someone says it’s easy, cautious programmers ask “What’s the catch?” Well, of course, that’s one of the major topic we’ll address in this deep dive session. We will start with a fast introduction to parallel and asynchronous programming with Java 8 and quickly delve into the gotchas, when to use these facilities, when to avoid them, and how and where to put them to good use.

Комментарии • 91

  • @user-gk4zw9sf4r
    @user-gk4zw9sf4r 4 года назад +104

    26:43 parallel() and sequential() the last one called wins.
    43:40 forEachOrdered()
    1:01:00 identical value for reduce operation. Here is my question, if the reduce operation always requires an identical value for initializing it, why doesn't Java omit the parameter?
    1:05:00 How many threads should I create?
    1:15:36 configuring number of threads JVM wide
    1:34:27 CompletableFutures
    1:38:10 Lesson from Javascript--Promise
    1:39:22 Exception handling and functional programming are mutually exclusive.
    1:47:00 Famous or popular functional interfaces;
    2:00:47 Thread of execution.
    2:12:11 Comparison of stream and completableFuture
    2:17:44 Pipeline of completableFuture
    2:27:44 Exceptionally
    2:44:18 Succeed on timeout
    2:53:32 Combine and compose

    • @moshecsbgu1
      @moshecsbgu1 4 года назад +5

      "If the reduce operation always requires an identical value for initializing it, why doesn't Java omit the parameter?"
      Not identical but IDENTITY. For different domains and operations you may have different identity values.
      For example, for integers and '+' the identity is 0, but for integers and '*' the identity is 1.

    • @akshayshukla2640
      @akshayshukla2640 3 года назад

      @@moshecsbgu1 u r a good listener 🙂

    • @lonbpalmer
      @lonbpalmer 3 года назад

      Thank you so much for this!

    • @dhirajnavale3861
      @dhirajnavale3861 Год назад

      not all heroes wear capes, thank you @user-gk4zw9sf4r

    • @manuel__Youtube
      @manuel__Youtube 11 месяцев назад

      Why my completalefuture works good with multiple threads in a 2 core system but not in >2 cores?

  • @MeplaSN
    @MeplaSN 4 года назад +45

    I will recommend this to anyone who is ever interested in understanding Streams and CompletableFutures in Java. It helped me immensely when I started working with Java in my new job after 5 years of Python. Wonderful presentation!

  • @jorgevillarreal2245
    @jorgevillarreal2245 3 года назад +6

    This guy has to be on something to be able to explain it so flawlessly. Thanks for the video man !

  • @rathinmaheswaran
    @rathinmaheswaran 3 года назад +6

    Finished watching this video for three days . Was tough to analyse and digest it initially. U r my hero Venky brother ❤️

  • @thepeerdependency
    @thepeerdependency Год назад +3

    I love this guy's talks. Undoubtedly the best videos on Java.

  • @pdukale9
    @pdukale9 2 года назад +1

    Explained in a Simple and practical way, this is the way an expert teaches, he makes complex things simple

  • @wwhill8033
    @wwhill8033 5 лет назад +13

    So well done, and very understandable. Venkat you are my Hero!!

  • @codeclandelivery3997
    @codeclandelivery3997 3 года назад

    I'm sharing this video to anyone I know who's ever made remarks about Java being stuck in the past! Venkat is such a great speaker - such a legend.

  • @brujua7
    @brujua7 5 лет назад +11

    Keep an eye on Project Loom, an addition to the Java VM for very lightweight user-mode threads (fibers) .

  • @madhanganesh1
    @madhanganesh1 4 года назад +4

    This is awesome talk. Venkat really tied down to all 3+ hours with very interesting talk

  • @HelloWorld-us9td
    @HelloWorld-us9td 5 месяцев назад

    This is the best video of CompletableFuture I have ever seen.

  • @lamhoi5904
    @lamhoi5904 2 года назад +1

    After watching this video, I found out I spent too much time to watch entertain videos, miss this kind of amazing learning videos, then I think I will do the master switch like in video

  • @padcom
    @padcom 9 месяцев назад

    Always a pleasure to listen to Venkat!

  • @TheTarnonero
    @TheTarnonero 3 года назад +1

    Thanks to venkat and devoxx. Venkat, you' have a wealth of knowledge that leaves me speechless every time. Your lessons are the best.

  • @zurumogbonda3225
    @zurumogbonda3225 Год назад

    Watching all Venkat videos and reading all his posts 🙌

  • @PennyToPound
    @PennyToPound Год назад +1

    Amazing style, very intuitive! Didn’t realise how three hours flied 😊😊 I felt like watching a Netflix series with the same concentration.. mind blowing

  • @akshayavenkatesan2912
    @akshayavenkatesan2912 Год назад +1

    This is gold. Lovvvveee the presentation and the way it was taught. Just perfectttt.. Thanks a tonne Venkat !

  • @Nampjg
    @Nampjg 3 года назад +1

    I have understood the difference between imperative and functional programming first time after listening to his talk :))

  • @neutronstar6739
    @neutronstar6739 3 года назад +3

    I wish i found this video when i was working with asynchronous functions in java

  • @BharCode09
    @BharCode09 4 года назад +15

    "While you are debugging the code, you applied for another job- that's called concurrency!". "Synchronize and suffer model"...
    Omfg so true! That's exactly how it screwed developers' not only career but also life.

  • @brujua7
    @brujua7 5 лет назад +4

    Great, amazing talk! Very well carried and so dense in the good sense. Really deserves a full course. Thank you!
    Next time please leave the question part on the video, it must have been very good judging from the knowledgeable audience.

  • @baburaomulaparthi4531
    @baburaomulaparthi4531 Год назад

    Hi sir
    Thank you so much for sharing intense knowledge on Compleatablefuture and streams.

  • @emoutraspalavras-marloncou4459
    @emoutraspalavras-marloncou4459 2 года назад +2

    I love how hilarious he is. Very good lecture, professor. I could learn from hours and hours. I first met functional programming thanks to Haskell and I was amazed when I found out that Java had introduced to Java world a functional API. And I was even more surprised to see people using it in the marketplace. For example, in the Spring Framework you end up resorting to functional techniques all the time.

  • @PheonxD
    @PheonxD 2 года назад +1

    Amazing presentation! That was a great introduction to streams and CompletableFuture, easy to understand and follow despite the concepts being hard to grasp. I feel inspired to play around with it myself :D
    I’ll recommend this to anyone confused with those topics. Thanks a lot, Venkat and Devoxx for sharing it for free!

  • @blingsingh1057
    @blingsingh1057 4 года назад +3

    Thanks @Devoxx team

  • @neuemage
    @neuemage 6 лет назад +10

    Venkat is the best!
    not even interested in java im watching the whole thing lol

  • @DebabrataPatnaik
    @DebabrataPatnaik 2 года назад

    Just one line its awsome even after 10 years.

  • @lamhoi5904
    @lamhoi5904 2 года назад

    amazing, it really covers all the concepts I am looking for to learn, not just the ones in titles, for the parts don't understand for me and you, can go further into it, love you

  • @narasimharao7576
    @narasimharao7576 2 года назад

    Thanks Venkat! What an awesome talk!

  • @marshdsilva32
    @marshdsilva32 6 лет назад +4

    Amazing I am getting addicted

  • @SaravananD
    @SaravananD 3 года назад +1

    The software developer saying to his boss that the project "completedExceptionally" is a good one :)

  • @ITech2005
    @ITech2005 4 года назад +1

    This is so underrated.

  • @Joseph-oz7tx
    @Joseph-oz7tx 9 месяцев назад +1

    The Venkat jokes kill me 🤣😂😅 no no no we shouldn't understand quickly

  • @KoenDeJaeger
    @KoenDeJaeger 5 лет назад +3

    Great teacher!

  • @baburaomulaparthi4531
    @baburaomulaparthi4531 Год назад

    Can you please upload classes on jvm architecture and working of jvm.

  • @vaneetsharma735
    @vaneetsharma735 3 года назад

    amazing. Thank you very much Venkat

  • @tomaszzasada956
    @tomaszzasada956 2 года назад +2

    Really nice video. However he really wanted to look like he doesn't need IDE, but after few hours of lecture he started making simple mistakes that every IDE would point out immediately.

  • @mattgraves3709
    @mattgraves3709 3 года назад

    I love your talks Venkat

  • @Baroquepassion
    @Baroquepassion 3 года назад

    extremely helpful and interesting.

  • @IwanSatria
    @IwanSatria 4 года назад +3

    I still don't understand this part (2:21:16). Why does it return 2 instead of 5? The chain should already be extended by then, right? Why is it overwritten with the "thenAccept" instead?

    • @Brajgamer
      @Brajgamer 4 года назад +4

      Good question
      That's because at line 13 the call to thenAccept creates a new pipeline and it's not wired to pipeline above it at line 6. It is rather a completely new pipeline rewired to line 19 separately.
      That's because the lazy evaluation of the code. Both pipeline at line 6 and at the line 13 aren't triggered until there is call to complete at line 19
      And at that time both triggered parallely and the second pipeline at line 13 is only printing the data

    • @rahuldeepattri9244
      @rahuldeepattri9244 4 года назад +2

      @@Brajgamer Many thanks!!!

  • @souvaniksaha
    @souvaniksaha 11 месяцев назад

    If I want to use map with parallel stream and I want to maintain order. In that case how is it possible ?

  • @Coding-pp9pu
    @Coding-pp9pu 5 месяцев назад

    1:17:53 Result is not same in both cases.. notice last digits 22944E12 and 2295E12

  • @thatoneuser8600
    @thatoneuser8600 2 года назад

    2:07:00 important
    2:10:40 why to use thenRun

  • @nosh3019
    @nosh3019 2 года назад

    So valuable, if only i could like twice :)

  • @devk5061
    @devk5061 6 месяцев назад

    Venkat is like sivaji the bossss.!!!!!!!❤

  • @uditgupta6997
    @uditgupta6997 5 лет назад

    Absolutely amazing talk

  • @sureshnaidu6276
    @sureshnaidu6276 3 года назад

    Thanks venkat🙏🙏

  • @AjayYadav-rs9nj
    @AjayYadav-rs9nj 2 года назад

    Need to move records from one schema to another schema in db. how can we achieve using Multithreading ?

  • @63_prathameshzore2
    @63_prathameshzore2 Год назад

    what is that editor he is using ?? btw great talk.

  • @RamKumar-rg3gr
    @RamKumar-rg3gr 3 года назад

    Well done pandit ji

  • @charan775
    @charan775 Год назад

    any idea which text editor he's using?

  • @debkr
    @debkr Год назад

    Awesome 👍

  • @dumizel
    @dumizel 9 месяцев назад

    supa great, thx)

  • @dpkpk1573
    @dpkpk1573 2 года назад

    Excellent

  • @KinGxWolF
    @KinGxWolF 3 года назад

    Venkat the 🐐!!!!

  • @javastreamsapimicroservice9319
    @javastreamsapimicroservice9319 2 года назад

    What ide are u using

  • @UmeshKumar-pq3kc
    @UmeshKumar-pq3kc 3 года назад

    Just Awesome

  • @guvenseckin542
    @guvenseckin542 4 года назад

    Thanks man

  • @nandakumar2933
    @nandakumar2933 3 года назад

    impressive !

  • @Saurabhnaik
    @Saurabhnaik 3 года назад +1

    Which editor is this?

  • @rahuldeepattri9244
    @rahuldeepattri9244 4 года назад

    Just Wow!

  • @padcom
    @padcom 9 месяцев назад

    Might I add that the API in Java is a massacre compared to ECMAScript's version, and that is the nicest way I can express what was shown here without resolving to French

  • @talesara74
    @talesara74 3 года назад

    But I want to argue why did you choose such a complex example explaining parallell programming and asynch programming!

  • @andy12829
    @andy12829 8 месяцев назад

    Brahmin People are so Intelligent 🧠 , Venkat Is an example ❤

  • @relaxsightme
    @relaxsightme 6 лет назад

    nice talk

  • @hi10drakk
    @hi10drakk 3 года назад

    what is the text editor? looks transparent

  • @yotubecreators47
    @yotubecreators47 6 лет назад

    best talk ever

    • @RonTheFlyingDutchman
      @RonTheFlyingDutchman 4 года назад

      Then this is the best blog ever: www.baeldung.com/java-completablefuture

  • @ShekharPrasadRajak
    @ShekharPrasadRajak 3 года назад

    Just ❤️

  • @sudosai
    @sudosai 9 месяцев назад

    1:34:26

  • @RoloJE1
    @RoloJE1 4 года назад +2

    Here is a cheesy joke. Why was main so busy with 7. Well, because main was afraid of 7 as 789....

  • @eigbiremolenaugustine6737
    @eigbiremolenaugustine6737 6 лет назад

    Great!! Does anybody know the IDE he used?

  • @michelleIX
    @michelleIX 2 года назад

    28:04 He was talking so fast..holy s.I thought it was fast forwarding

  • @Abitgenius
    @Abitgenius 4 года назад +1

    ...and what took 12 minutes to run now took exactly TWELVE minutes to run.. haha 20:00

  • @AhmetSezginDuran
    @AhmetSezginDuran 5 лет назад +4

    "...That's called concurrency" 12:55
    ROFL!

  • @sundargautambabaji
    @sundargautambabaji 3 года назад

    47:23

  • @alexhelkar
    @alexhelkar 4 года назад

    Thanks Venkat! What an awesome talk!