Feedback on structured concurrency
    Bart De Neuter 
    bdeneuter at gmail.com
       
    Tue Oct 22 07:56:25 UTC 2024
    
    
  
As we are using structured concurrency in production, we would like to give
some feedback.
We created an adapter
for java.util.concurrent.StructuredTaskScope.ShutdownOnFailure for the
following reasons:
   1. To translate checked exceptions to a RuntimeException. The current
   implementation throws an InterruptedException when calling the join method
   which is a checked exception. This forces the code that uses
   ShutdownOnFailure to handle the exception explicitly or mark their method
   to throw this checked exception.
   2. When calling join, our adapter changes the behaviour from the join
   method to throw exceptions by default by calling throwIfFailed under the
   hood. Our adapter provides an explicit method if a developer doesn't want
   to have an exception thrown.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20241022/5f4b9df8/attachment.htm>
    
    
More information about the loom-dev
mailing list