{"id":15839788,"url":"https://github.com/pythonista7/ratelimited","last_synced_at":"2025-10-07T06:17:52.338Z","repository":{"id":65496224,"uuid":"589014437","full_name":"Pythonista7/ratelimited","owner":"Pythonista7","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-15T03:01:59.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T16:55:25.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pythonista7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-14T19:31:19.000Z","updated_at":"2023-09-17T14:04:14.000Z","dependencies_parsed_at":"2023-02-09T21:01:03.505Z","dependency_job_id":null,"html_url":"https://github.com/Pythonista7/ratelimited","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pythonista7%2Fratelimited","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pythonista7%2Fratelimited/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pythonista7%2Fratelimited/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pythonista7%2Fratelimited/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pythonista7","download_url":"https://codeload.github.com/Pythonista7/ratelimited/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pythonista7%2Fratelimited/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166890,"owners_count":22815585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T16:21:44.190Z","updated_at":"2025-10-07T06:17:47.304Z","avatar_url":"https://github.com/Pythonista7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ratelimited\n\nJust a simple wrapper over [ratelimit](https://github.com/uber-go/ratelimit). :)\n\n## Example\n\nSee a working example [here](github.com/pythonista7/ratelimited/example/example.go). But here's the idea:\n\n```go\nfunc main() {\n\tconst targetRPM int = 100\n    queue := make(chan (string), 25)\n    /*\n    This will create an instance of the ratelimitedworker.\n    - id: primary identifier for the ratelimiter Job the work is assosiated to\n    - targetRPM: the expected maximum rate limit to perform at\n    - hasty: if true maintains a higher RPS good for work() that takes long, false forces rate below the limit.\n    - verbose: enable logging\n    */\n    rlw := ratelimitedworker.Create(\"sampleId\", targetRPM, true, true)\n    go queueLoader(queue)\n    go doLotsOfWork(rlw,queue)\n}\n\nfunc doLotsOfWork(rlw *ratelimitedworker.RLW, queue chan (string)) {\n\n\tfor range queue {\n\t\t// this will allow the work() to be called only rlw.targetRPM number of times during a minute\n\t\trlw.Track() // if limit is hit for the time period it will block this go routine\n\t\tgo work()\n\t}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonista7%2Fratelimited","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonista7%2Fratelimited","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonista7%2Fratelimited/lists"}