fetchify
import fetchify from "https://deno.land/x/fetchify@0.1.3/mod.ts";
const endpoint = "https://jsonplaceholder.typicode.com";
const limit = new fetchify.Limiter({
rps: 3,
});
for (let i = 20; i--;) {
console.log(`push to queue ${i}`);
limit.fetch(`${endpoint}/posts/${i}`).finally(() => {
console.log(`finally ${i}`);
});
}