grempe / ex_rated

ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to list the existing buckets?

jaimeiniesta opened this issue · comments

Is there a way to list the buckets that are currently defined? I guess I can read them from the ETS table, but maybe there's a cleaner way to do that, something like ExRated.list_buckets.

I need this because I'm going to be scraping web sites, so I want to limit the number of requests to each site. Each site will have a temporary bucket with a dynamic name ("example.com", "github.com") that will be deleted when finished, but I want to know, at a given time, how many buckets are defined and their state.

This functionality is not currently provided. Pull requests with tests are welcome though.

Thanks for your interest.