<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">Just like a connect pool to a db - a well designed “resource” has a layer where similar concurrency controls would occur.</div><div dir="ltr"><br></div><div dir="ltr">The throttling is not “http requests” it is the requests to a particular resource - so you have a service endpoint and any required throttling occurs there. (Even if the endpoint is in process)</div><div dir="ltr"><br></div><div dir="ltr">Still this is not typically how this is done. Think if you are rate limited - by credentials - very common with big tech services - you need another layer across processes to control not exceeding the limit. </div><div dir="ltr"><br></div><div dir="ltr">What you propose has very limited utility and for those cases a simple resource access layer is all that is needed. </div><div dir="ltr"><br><blockquote type="cite">On Aug 6, 2023, at 5:21 PM, Attila Kelemen <attila.kelemen85@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr">Robert Engels <<a href="mailto:rengels@ix.netcom.com">rengels@ix.netcom.com</a>> ezt írta (időpont: 2023. aug. 7., H, 0:05):<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr"></div><div dir="ltr">That is nonsensical.  It would mean you would have to pass the supplier to multi threads of execution or you would only have a single execution possible. </div><div dir="ltr"><br></div></div></blockquote><div>I'm not sure where your confusion is coming from. This limits the number of concurrent execution of all the actions passed to it. Of course, you will have to use multiple threads. A single thread does not need to have such a constraint.</div><div><br></div><div> </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="auto"><div dir="ltr"></div><div dir="ltr">So the interface does nothing in the case. Use a semaphore if you need to limit concurrency - call the supplier directly if you don’t. </div><div dir="ltr"><br></div><div dir="ltr">You added a layer that doesn’t do anything but is obscure the code/intent. </div><div dir="ltr"></div><blockquote type="cite"><div dir="ltr"><br></div></blockquote></div></blockquote><div>I think you misunderstand the point. The implementation might not know what kind of constraints you want to put on it. In fact, it is possible that you want to put multiple things under the same constraint. For example, you might want to limit the number of concurrent http calls in your application, and there could very well be independent things making such calls. You don't want to pass around naked semaphores.</div></div></div>
</div></blockquote></body></html>