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.
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
"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.
@@moshecsbgu1 u r a good listener 🙂
Thank you so much for this!
not all heroes wear capes, thank you @user-gk4zw9sf4r
Why my completalefuture works good with multiple threads in a 2 core system but not in >2 cores?
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!
This guy has to be on something to be able to explain it so flawlessly. Thanks for the video man !
Finished watching this video for three days . Was tough to analyse and digest it initially. U r my hero Venky brother ❤️
I love this guy's talks. Undoubtedly the best videos on Java.
Explained in a Simple and practical way, this is the way an expert teaches, he makes complex things simple
So well done, and very understandable. Venkat you are my Hero!!
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.
Keep an eye on Project Loom, an addition to the Java VM for very lightweight user-mode threads (fibers) .
This is awesome talk. Venkat really tied down to all 3+ hours with very interesting talk
This is the best video of CompletableFuture I have ever seen.
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
Always a pleasure to listen to Venkat!
Thanks to venkat and devoxx. Venkat, you' have a wealth of knowledge that leaves me speechless every time. Your lessons are the best.
Watching all Venkat videos and reading all his posts 🙌
Amazing style, very intuitive! Didn’t realise how three hours flied 😊😊 I felt like watching a Netflix series with the same concentration.. mind blowing
This is gold. Lovvvveee the presentation and the way it was taught. Just perfectttt.. Thanks a tonne Venkat !
I have understood the difference between imperative and functional programming first time after listening to his talk :))
I wish i found this video when i was working with asynchronous functions in java
"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.
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.
Hi sir
Thank you so much for sharing intense knowledge on Compleatablefuture and streams.
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.
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!
Thanks @Devoxx team
Venkat is the best!
not even interested in java im watching the whole thing lol
Just one line its awsome even after 10 years.
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
Thanks Venkat! What an awesome talk!
Amazing I am getting addicted
The software developer saying to his boss that the project "completedExceptionally" is a good one :)
This is so underrated.
The Venkat jokes kill me 🤣😂😅 no no no we shouldn't understand quickly
Great teacher!
Can you please upload classes on jvm architecture and working of jvm.
amazing. Thank you very much Venkat
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.
I love your talks Venkat
extremely helpful and interesting.
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?
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
@@Brajgamer Many thanks!!!
If I want to use map with parallel stream and I want to maintain order. In that case how is it possible ?
1:17:53 Result is not same in both cases.. notice last digits 22944E12 and 2295E12
2:07:00 important
2:10:40 why to use thenRun
So valuable, if only i could like twice :)
Venkat is like sivaji the bossss.!!!!!!!❤
Absolutely amazing talk
Thanks venkat🙏🙏
Need to move records from one schema to another schema in db. how can we achieve using Multithreading ?
what is that editor he is using ?? btw great talk.
Well done pandit ji
any idea which text editor he's using?
Awesome 👍
supa great, thx)
Excellent
Venkat the 🐐!!!!
What ide are u using
Just Awesome
Thanks man
impressive !
Which editor is this?
Just Wow!
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
But I want to argue why did you choose such a complex example explaining parallell programming and asynch programming!
Brahmin People are so Intelligent 🧠 , Venkat Is an example ❤
nice talk
what is the text editor? looks transparent
best talk ever
Then this is the best blog ever: www.baeldung.com/java-completablefuture
Just ❤️
1:34:26
Here is a cheesy joke. Why was main so busy with 7. Well, because main was afraid of 7 as 789....
Great!! Does anybody know the IDE he used?
textmate
i would like to know as well
28:04 He was talking so fast..holy s.I thought it was fast forwarding
...and what took 12 minutes to run now took exactly TWELVE minutes to run.. haha 20:00
"...That's called concurrency" 12:55
ROFL!
47:23
Thanks Venkat! What an awesome talk!