[StructuredTaskScope] Poor man's "back pressure" ?

Benoit LEFEVRE -CAMPUS- benoit.lefevre at decathlon.com
Mon Dec 15 17:46:09 UTC 2025


Hello

I recently wondered if there was any room left to implement some kind of
poor man's "back pressure" system thanks to the latest version of
StructuredTaskScope ?

Behind this "poor man's back pressure" term, I have in mind something like :


   - an endpoint to be called for X distinct IDs
   - a loop that "*.fork"* the M first calls, then wait until one complete
   before forking the M+1 call ...
   - ... and so on until all calls got forked
   - then wait for the remaining calls completions by calling the join
   method

The point being of course to have at most M calls in flight at a time

I doubt it's still possible to do it seeing the latest evolution of the API
in Java 25, especially since the "event callbacks" from the Java 21
implementation don't seem to be available anymore, but maybe I'm wrong ?

Looking forward to your advice about it !

Best regards.


-- 
Benoit Lefèvre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251215/8be0f788/attachment.htm>


More information about the loom-dev mailing list