Modern Backend - Parallel Processing Refactoring (1)

Modern Backend - Parallel Processing Refactoring (1)

[Modern Backend] This is the fifth session of Part 1 of the course, "Refactoring Parallel API Calls (1)."
In this session, we will conduct a preliminary structural analysis and design the refactoring needed to migrate the bulletin board project's attachment validation and thumbnail generation logic from the existing CompletableFuture approach to code based on Java 25's structured concurrency (StructuredTaskScope).

📌 Key topics:

  • Analysis of the files targeted for refactoring and review of the existing CompletableFuture-based parallel API call approach

  • Analysis of the limitations of the existing approach (the inability to propagate cancellation to other parallel tasks when an exception occurs, and issues with thread lifecycles)

  • Verification of the lack of cancellation propagation through the PostCreationCoordinatorTest unit test

  • Enabling Java 25 preview features (--enable-preview) in build.gradle

  • Understanding the code conversion flow and five-step execution structure based on StructuredTaskScope (fork, join, get)

Step by step, explore the theory and design process of how structured concurrency can address the resource leaks and fragmented exception handling in existing asynchronous code.

https://www.youtube.com/watch?v=T62CtaVNInQ


Site footer