{"id":17947570,"url":"https://github.com/soenneker/soenneker.utils.ratelimiting.executor","last_synced_at":"2026-06-06T02:09:40.556Z","repository":{"id":259157268,"uuid":"876446465","full_name":"soenneker/soenneker.utils.ratelimiting.executor","owner":"soenneker","description":"A thread-safe utility designed to manage the rate at which tasks are executed, ensuring that they are not run more frequently than a specified interval.","archived":false,"fork":false,"pushed_at":"2026-04-14T20:11:07.000Z","size":964,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-14T21:30:38.655Z","etag":null,"topics":["api","csharp","dotnet","executor","limit","limiting","rate","ratelimiting","ratelimitingexecutor","util","utils"],"latest_commit_sha":null,"homepage":"https://soenneker.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soenneker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"soenneker","thanks_dev":"soenneker"}},"created_at":"2024-10-22T01:35:10.000Z","updated_at":"2026-04-14T19:59:42.000Z","dependencies_parsed_at":"2026-04-22T01:00:55.982Z","dependency_job_id":null,"html_url":"https://github.com/soenneker/soenneker.utils.ratelimiting.executor","commit_stats":null,"previous_names":["soenneker/soenneker.utils.ratelimiting.executor"],"tags_count":101,"template":false,"template_full_name":null,"purl":"pkg:github/soenneker/soenneker.utils.ratelimiting.executor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.ratelimiting.executor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.ratelimiting.executor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.ratelimiting.executor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.ratelimiting.executor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soenneker","download_url":"https://codeload.github.com/soenneker/soenneker.utils.ratelimiting.executor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.ratelimiting.executor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32116514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"ssl_error","status_checked_at":"2026-04-22T00:30:22.894Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","csharp","dotnet","executor","limit","limiting","rate","ratelimiting","ratelimitingexecutor","util","utils"],"created_at":"2024-10-29T08:05:46.681Z","updated_at":"2026-04-22T01:01:06.960Z","avatar_url":"https://github.com/soenneker.png","language":"C#","funding_links":["https://github.com/sponsors/soenneker","https://thanks.dev/soenneker"],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/nuget/v/soenneker.utils.ratelimiting.executor.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.utils.ratelimiting.executor/)\n[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.ratelimiting.executor/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.utils.ratelimiting.executor/actions/workflows/publish-package.yml)\n[![](https://img.shields.io/nuget/dt/soenneker.utils.ratelimiting.executor.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.utils.ratelimiting.executor/)\n[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.ratelimiting.executor/codeql.yml?label=CodeQL\u0026style=for-the-badge)](https://github.com/soenneker/soenneker.utils.ratelimiting.executor/actions/workflows/codeql.yml)\n\n# ![](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Utils.RateLimiting.Executor\n### A thread-safe utility designed to manage the rate at which tasks are executed, ensuring they are not run more frequently than a specified interval. \n\n`RateLimitingExecutor` is ideal for interacting with rate-limited APIs or throttling the execution of resource-intensive tasks.\n\n### Sequential Execution\n\n`Tasks`, `ValueTasks`, and `Actions` are executed one at a time. If the defined interval between executions has passed, the task runs immediately; otherwise, it waits until the interval elapses before proceeding.\n\n?? Important Notes:\n\n- This is not a background queue processor. Each method awaits the result of the asynchronous operation before continuing.\n\n- Asynchronous methods will not block the calling thread, but synchronous methods will block execution until it completes.\n\n### Want to use this with dependency injection? \n\nCheck out the singleton factory implementation: [Soenneker.Utils.RateLimiting.Factory](https://github.com/soenneker/soenneker.utils.ratelimiting.factory)\n\n## Installation\n\n```\ndotnet add package Soenneker.Utils.RateLimiting.Executor\n```\n\n## Example: Executing a Loop of Tasks with Rate Limiting\n\nBelow is an example demonstrating how to use the RateLimitingExecutor to execute a series of tasks while maintaining a rate limit.\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Soenneker.Utils.RateLimiting.Executor;\n\npublic class Program\n{\n    public static async Task Main(string[] args)\n    {\n        var rateLimitingExecutor = new RateLimitingExecutor(TimeSpan.FromSeconds(2));\n\n        for (int i = 0; i \u003c 5; i++)\n        {\n            await rateLimitingExecutor.Execute(async ct =\u003e\n            {\n                Console.WriteLine($\"Executing Task {i + 1} at {DateTime.Now:HH:mm:ss}\");\n                await Task.Delay(100); // Simulate some work\n            });\n        }\n    }\n}\n```\n\n### Console Output\n\n```csharp\nExecuting Task 1 at 14:00:00\nExecuting Task 2 at 14:00:02\nExecuting Task 3 at 14:00:04\nExecuting Task 4 at 14:00:06\nExecuting Task 5 at 14:00:08\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoenneker%2Fsoenneker.utils.ratelimiting.executor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoenneker%2Fsoenneker.utils.ratelimiting.executor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoenneker%2Fsoenneker.utils.ratelimiting.executor/lists"}