Java Asynchronous Programming Full Tutorial with Loom and Structured Concurrency - JEP Café #13

preview_player
Показать описание
Watch a live tutorial on how you can build real applications on top of virtual threads using the Structured Concurrency API, available as an incubator API in the JDK 19.

⎯⎯⎯⎯⎯⎯ Chapters ⎯⎯⎯⎯⎯⎯

0:00 Intro
1:42 Two things about Virtual Threads
2:55 Writing asynchronous code
4:14 Moving asynchronous code to Virtual Threads
5:22 Introducing Loom Scopes
6:35 Live demo: a first StructuredTaskScope
9:13 Differences between Scopes and Executors
11:02 Introducing the ShutdownOnSuccess Scope
11:49 Live demo: using ShutdownOnSuccess
16:40 Exception handling
17:06 Creating a custom Scope in action
25:45 Tips to write unit tests
26:34 Live demo: handling different object types
33:10 Live demo: adding a timeout on your Scope
34:35 Using ExtentLocal instead of ThreadLocal
35:24 Live demo: using ExtentLocal in a single thread
37:04 Live demo: using ExtentLocal with scopes
39:17 Scope wrap up
40:31 Final words and outro

⎯⎯⎯⎯⎯⎯ Resources ⎯⎯⎯⎯⎯⎯

Tags: #Java #ConcurrentProgramming #Loom #Java19 #OpenJDK #JDK #JDK19 #VirtualThreads #ConcurrentProgramming #JEPCafe #InsideJava
Рекомендации по теме
Комментарии
Автор

This channel is getting better and better!

tintifax
Автор

Hi mr Paumard. I am a Java enthusiast, developing as an hobby for ten years. I love Java! You know, I am completely paralysed and stuck on a wheelchair since the early beginning of my life. You know, Java is giving me the the opportunity to express my self by developing and lefting apart my physical issues.
Great video really!
Btw, how could I get a Java cup as that you are using? 😀
Thanks

FABGIO
Автор

'.. The interruptions are handled by Scope object ..': this is one of the key benefits of what Loom offers, IMO. This has been a serious point of pain, in many of my projects (including Scala and Akka) over years. Many thanks for such a lucid elaboration, Sir. I also like the importance that you attach to the risk of running countless number of threads, without any care in the world. Many websites/blogs/framework are advertising the profligacy which may seep in because APIs are simpler.

nirmalyasengupta
Автор

This, JEP Cafe, along with Sip of Java, Inside Java, and others, helps this channel become vibrant, interesting, and one of the goto channels for Java-related contents. Keep up the good work Java channel.

julianjupiter
Автор

The video is great and the Java syntax is getting better and better. Look forward to JDK19 and the next TLS release

usglgeo
Автор

Great presentation ! It's a privilege for young programmers like me to learn the craft directly from the veterans. Thank you for the video.
Sharing my little story: After being in the Java world for a while, a job switch saw me working outside of Java. Though it meant me missing out on Java for a while, now i feel fortunate that happened. Because, i was able to happily miss all the buzz around async programming. While i appreciated the efficiency argument; i just couldn't accept the huge degradation in readability.
Now, with Loom and structured concurrency, am glad i get to keep the readability of blocking style overall, while still leveraging the efficiency of non-blocking style where it is required.

JobinJacobKavalam
Автор

This is awesome ! Thanks Mr. Paumard ❤️

MakeItStik
Автор

It couldn't get any better. That's simply Beautiful. Thank you very much Paumard, love your content.

adilhassan
Автор

Thank you! I really missed the feeling when i used to get new java code tips from sun newsletters 😀 and this episode returned me to those days 😀👍

askarkalykov
Автор

Hey everyone, I think the boss is noticing how long our coffee breaks are.

edmaphis
Автор

Very informative presentation. Thanks for publishing!
💙Java is awesome💚

VisruthCV
Автор

Gonna be honest, i was drawn to Go because of its concurrency paradigm. But this is kind of a game changer. Leveraging the entire Java ecosystem while being able to tackle c10k without the use of reactive code infecting the entire condebase is huge.

nubunto
Автор

Having been programming in Java for about 20 years I love the direction java is taking. I recently found the JEP Café series and I love it!

However, I found the pattern of creating TravelScope and QuotationScope a little too cumbersome. You have to create a class, override a method, write a bunch of switch blocks, which totally breaks the flow of the logic. It makes me think that there should be a simple pattern to accomplish the same thing.

dtafneto
Автор

Suggestion to the presenter: Post your name in the video description, and within the video too.

basilbourque
Автор

I just can't understand how you managed to drink a cofee in 40 minutes.

alathreon
Автор

I have taken his course on Pluralsight! He is really awesome 😎 ! This channel is on 🔥

DineshkumarPuli
Автор

At 7:40, he says, "So now, let me make this code asynchronous" and then adds a StructuredTaskScope. I don't think he meant to say asynchronous. I think he made a mistake.

Otherwise, great video, and great job Java team on virtual threads and structured concurrency!

claytonwohl
Автор

Seems unfortunate if you need to override Scope classes to handle results, especially if you need it to be thread-safe.
Looks like it would be better if you could tell fork() what handling is expected (expect success, expect success or exception, set timeout) then do all the handling of the results synchronously, after the join().

DavidDLee
Автор

As usual your videos explain the Java features in a clear and easy way.
I have two questions though:
How can a task know it is cancelled?
How to cancel other tasks via the Handle overriden method?

aharonha
Автор

Thank you for this awesome presentation. Please where can I get this java mug😢?

yagoubjakoub