This is the second lecture of the fifth session in Part 1 of the [Modern Backend] course, titled "Refactoring Parallel API Calls (2)."
In this lecture, we will conduct a live coding session in which we write and test the actual code for the bulletin board project based on the structured concurrency (StructuredTaskScope) architecture designed in the previous session.
📌 Key Learning Topics:
-
Verifying the limitations and behavior of the existing CompletableFuture-based test code
-
Disabling and enabling the Java 25 preview option (--enable-preview) in build.gradle
-
Implementing parallel task fork(), join(), and get() using try-with-resources and StructuredTaskScope
-
Deleting the existing ExecutorService thread pool configuration (AppConfig), which is no longer needed
-
Adding exception handling for the StructuredTaskScope.FailedException exception in GlobalExceptionHandler
-
Verifying exception propagation and cancellation behavior by running unit tests after completing the refactoring
Take a look at the practical refactoring process of cleanly transitioning from existing thread pool-based code to structured concurrency code.