<div dir="ltr">If I'm understanding your problem correctly, then you can just use semaphores to limit the number of concurrent actions.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Benoit LEFEVRE -CAMPUS- <<a href="mailto:benoit.lefevre@decathlon.com">benoit.lefevre@decathlon.com</a>> ezt írta (időpont: 2025. dec. 15., H, 18:47):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">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 ?<br><br>Behind this "poor man's back pressure" term, I have in mind something like :<br></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><ul><li>an endpoint to be called for X distinct IDs</li><li>a loop that "<b><font face="monospace">.fork"</font></b> the M first calls, then wait until one complete before forking the M+1 call ... </li><li>... and so on until all calls got forked</li><li>then wait for the remaining calls completions by calling the join method</li></ul></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>The point being of course to have at most M calls in flight at a time</div><div><br></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>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 ?</div><div><br></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>Looking forward to your advice about it !</div><div><br></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>Best regards.</div></blockquote></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Benoit Lefèvre</div></div></div>
</blockquote></div>