Building a Rate-Limited Effect Service with Concurrency Control

What is the recommended way to build a rate-limited effect service? The idea is my app needs to call an external API with some service Api.get("something"), and I want to set a policy on the number of concurrent get requests and the total number per 10 minutes. I can see
Stream
has throttle which would work, but then I have to take the requests, put them in a queue, turn that into a stream, apply the throttle to it, use mapEffect(resolveRequest, {concurrency: 2 }) then somehow take the resolved value and get it back to the caller of get, maybe using Deferred?

Alternatively, there is the much simpler RateLimiter which I can wrap my effect in and will easily limit it by a time window and cost, but does not manage how many concurrent requests can happen.

Any recommendations here?
Was this page helpful?