Description

Evento ibrido online ed in presenza.

La partecipazione in presenza è gratuita e libera, ma è OBBLIGATORIA la registrazione su: https://www.eventbrite.com/e/flights-failures-and-forks-structured-concurrency-and-adt-in-java-tickets-2004669055108?aff=oddtdtcreator

Abstract dell'intervento:
Asking five airlines for a price at the same time sounds easy. Then one provider hangs, another fails, the user gives up, and your ExecutorService keeps running threads that nobody is waiting for anymore.

In this live coding session, we build a flight search aggregator from scratch in modern Java. First we model what can happen. Using records, sealed interfaces, and exhaustive pattern matching, every provider answer becomes a type (an offer, sold out, service down, too slow), and the compiler won't let us forget a case. Then we make the runtime respect that model. With StructuredTaskScope, still a preview API in JDK 27, concurrent calls start and end inside their parent: when one fails, the others are canceled; when time runs out, nothing is left behind; and the stack trace still tells a coherent story.

Along the way, we look inside structured concurrency to see how it works: scopes, subtasks, joiners, cancellation, and why virtual threads make it cheap. We finish by writing our own Joiner, where algebraic data types and structured concurrency meet to pick the best offer.

You will leave with a way to write concurrent Java where types make illegal states unrepresentable, and scope makes leaked threads impossible.

A cura di Riccardo Cardin:
WHO AM I

  • Senior Software Engineer, Lastminute.com
  • Main lecturer at the University of Padua (Software Engineering)
  • Passionate blogger at Rock The JVM
  • Maintainer of many OS projects both in Scala and Kotlin

Al termine dell'incontro, per chi lo desidera, andremo a mangiare qualcosa tutti insieme.