python-trio / trimeter

(not ready yet) A simple but powerful job scheduler for Trio programs
https://trimeter.readthedocs.io
Other
63 stars 3 forks source link

Support "keyed meters" #8

Open njsmith opened 6 years ago

njsmith commented 6 years ago

It would be nice if we could say "at most 50 tasks fetching URLs at once, and at most 5 of those for any given hostname". So that might look something like:

await run_on_each(fetch, urls, max_at_once=50, key=hostname_from_url, max_at_once_per_key=5)

This will create a dramatic increase in complexity. Considerations include: