{"id":17796975,"url":"https://github.com/lrascao/raterl","last_synced_at":"2025-03-17T03:30:28.994Z","repository":{"id":48715028,"uuid":"81481154","full_name":"lrascao/raterl","owner":"lrascao","description":"An erlang ETS based rate limiter inspired by Jobs","archived":false,"fork":false,"pushed_at":"2021-07-13T12:54:45.000Z","size":38,"stargazers_count":16,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2024-09-30T01:48:10.191Z","etag":null,"topics":["erlang","rate-limiter"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/lrascao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-09T18:25:11.000Z","updated_at":"2023-09-06T15:36:55.000Z","dependencies_parsed_at":"2022-09-17T01:13:19.997Z","dependency_job_id":null,"html_url":"https://github.com/lrascao/raterl","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Fraterl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Fraterl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Fraterl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Fraterl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lrascao","download_url":"https://codeload.github.com/lrascao/raterl/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221671212,"owners_count":16861220,"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":["erlang","rate-limiter"],"created_at":"2024-10-27T11:50:26.444Z","updated_at":"2024-10-27T11:50:27.036Z","avatar_url":"https://github.com/lrascao.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/lrascao/raterl/workflows/build/badge.svg)](https://github.com/lrascao/raterl)\n\n# raterl\n\nErlang flow control application heavily inspired in `jobs` and `ratx`,\nETS based bypasses the `jobs_server` single process bottleneck while\nproviding `rate` and `counter` flow control.\n\n## Supports\n\n## TODO\n\n  * Queues\n  * Modifiers\n\n## Examples\n\n### Rate flow control\n\nA typical use case is restricting the number of logins per second\non a system, you'd start by the configuration:\n\n```erlang\n[{raterl, [\n    {queues, [\n        {login_requests, [\n            {regulator, [\n                {name, max_login_rate}, \n                {type, rate},\n                {limit, 100}   %% ensures that we get no more than x logins per second\n            ]}\n        ]}\n    ]}\n  ]\n}].\n```\n\nThen on the code you ask permission from `raterl` before accepting a login:\n\n```erlang\n    case raterl:run(login_requests, {rate, max_login_rate}, fun () -\u003e Ret end) of\n        limit_reached -\u003e\n            {error, throttled};\n        Ret -\u003e Ret\n    end;\n```\n\nBuild\n-----\n\n    $ rebar3 compile\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrascao%2Fraterl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flrascao%2Fraterl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrascao%2Fraterl/lists"}