The Loom project is to make asynchronous programming simpler, enabling the "simple thread-per-request style to scale with near-optimal hardware utilization". Before virtual threads, this was only achievable with callback-based reactive programming.
In this lab, we'll guide you through writing a virtual thread-based web application that uses structured concurrency to parallelize requests, and implements different strategies to process them. Then you'll see how to use scoped values to pass sensitive info from one module of your application to another one, without relying on method parameters.
See the patterns of code the Loom project gives you to achieve the same throughput as a classical reactive application. You can then compare the code patterns of both approaches to choose which you prefer.
Type: Hands-on Lab (90 min)
Track: Core Java Platform
Audience Level: Expert