[StructuredTaskScope] Poor man's "back pressure" ?
Attila Kelemen
attila.kelemen85 at gmail.com
Mon Dec 15 19:29:08 UTC 2025
If I'm understanding your problem correctly, then you can just use
semaphores to limit the number of concurrent actions.
Benoit LEFEVRE -CAMPUS- <benoit.lefevre at decathlon.com> ezt írta (időpont:
2025. dec. 15., H, 18:47):
> 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/e25f1a61/attachment.htm>
More information about the loom-dev
mailing list