Synchronous executor interface

Robert Engels rengels at ix.netcom.com
Sun Aug 6 21:27:20 UTC 2023


But tbh - I don’t really know what you are asking for because you talk about limiting the number of requests but making it called on the same thread. I don’t even think that is possible. 

> On Aug 6, 2023, at 4:16 PM, Robert Engels <rengels at ix.netcom.com> wrote:
> 
> 
> That is not the way you would configure the db - that leaves you open to east DDoS attacks. Relying on well behaved/configured apps is the wrong way - you prevent/balance this at the database. 
> 
> The reason you wouldn’t add it is like all resources like this - you are trying to control it at the wrong location. 
> 
> Controlling the number of concurrent threads to control the number of requests to a resource is simply wrong. You do it at a lower level (semaphore, etc) or in the resource itself. 
> 
>>> On Aug 6, 2023, at 3:45 PM, Attila Kelemen <attila.kelemen85 at gmail.com> wrote:
>>> 
>> 
>> Robert Engels <rengels at ix.netcom.com> ezt írta (időpont: 2023. aug. 6., V, 22:35):
>>> You wouldn’t design it that way. The database driver would (or database) would control the concurrency - and it would be configured externally. Why would attempt to do this at the app level - the database is an external shared resource. 
>> 
>> As soon as I pressed the send button, I realized that the DB is not a good example, though not as you wrote, since it is not normally the responsibility of the JDBC driver, but a connection pool which you configure (still you have to do that at app level as well usually).
>> 
>> Anyway, that does not change the fact that there are a lot of cases where you have to put a limit, and there is nothing readily available. Such as sending a http request to a service, and you might want to limit the number of concurrent access per service as well as the number of concurrent http calls (across all services). Of course, there are countless other reasons you might want to limit concurrent executions, and I see no reason not to add a single interface that would be widely usable across different domains.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230806/efc18d33/attachment-0001.htm>


More information about the loom-dev mailing list