What is Nostr?
Adam Bell :catPOWER: /
npub14mg…j6qw
2023-11-23 20:19:26

Adam Bell :catPOWER: on Nostr: Does anyone have recs for handling fetching multiple URL requests serially with ...

Does anyone have recs for handling fetching multiple URL requests serially with async/await but also abiding by rate limiting (i.e. limiting requests to only being done once every 0.2s).

I had it done with a TaskGroup, but that fires off all the requests in parallel.

I also tried this where I set a minimum timeout for each request and then delaying tasks, executing tasks via an AsyncSequence… but that just feels wrong. I thought I could use throttle() but that ends up just dropping events

Author Public Key
npub14mgtsuytcjprn4098dtx3xv6myh84g0nrxtwtr9uatevz8nfwz7sqfj6qw