JUG Milano Meeting #175

Giovedì 19 Novembre 2026

Flights, Failures and Forks: Structured Concurrency and Algebraic Data Types in Java


L'incontro si terrà Giovedì 19 Novembre 2026 presso eDream ODIGEO Via Fara 26 20124 Milano - evento gratuito previa registrazione OBBLIGATORIA (vedi dettagli) (mappa) in Via Gustavo Fara, 26, 20124 Milano MI .

Il talk sarà in Italiano.

Evento ibrido online ed in presenza.

La partecipazione **in presenza** è gratuita e libera, ma è OBBLIGATORIA la registrazione su: form di registrazione per partecipare a JUG Milano in presenza

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.

[ANNOUNCE] JUG Milano Meeting #175 - Flights, Failures and Forks: Structured Concurrency and Algebraic Data Types in Java

Ciao a tutti,

Siamo lieti di annunciare che un nuovo incontro del JUG Milano si terrà in modalità ibrida, Giovedì 19 Novembre 2026.


Evento ibrido online ed in presenza.

La partecipazione **in presenza** è gratuita e libera, ma è OBBLIGATORIA la registrazione su:
[form di registrazione per partecipare a JUG Milano in presenza](https://www.eventbrite.com/e/flights-failures-and-forks-structured-concurrency-and-adt-in-java-tickets-2004669055108?aff=oddtdtcreator)



Questo il programma:
h 18:45 - JUG news e attività in corso
h 19:00 - "Flights, Failures and Forks: Structured Concurrency and Algebraic Data Types in Java", a cura di Riccardo Cardin
h ~20:30 - Chiusura lavori, varie ed eventuali

Iscriviti al canale YouTube di JUG Milano https://www.youtube.com/@JUGMilano/streams e JUG Torino https://www.youtube.com/@JUGTorino/streams e clicca la campanella su YouTube: riceverai notifica direttamente da YouTube quando saremo live!

Potete trovare maggiori dettagli, direttamente sul nostro sito:
http://www.jugmilano.it/meeting-175.html

Vi aspettiamo!
 - JUG Milano staff

🗓️ Giovedì 19 Novembre 2026
👉 "Flights, Failures and Forks: Structured Concurrency and Algebraic Data Types in Java" in presenza e YouTube live!
🙏 presenta Riccardo Cardin

Hybrid mode:
🚨 per partecipare in presenza è richiesto questo form:

Evento ibrido online ed in presenza.

La partecipazione **in presenza** è gratuita e libera, ma è OBBLIGATORIA la registrazione su:
[form di registrazione per partecipare a JUG Milano in presenza](https://www.eventbrite.com/e/flights-failures-and-forks-structured-concurrency-and-adt-in-java-tickets-2004669055108?aff=oddtdtcreator)



⚠️
Dettagli: http://www.jugmilano.it/meeting-175.html