{"id":20755220,"url":"https://github.com/formix/formix.semaphore","last_synced_at":"2025-07-15T01:10:12.381Z","repository":{"id":84235131,"uuid":"144064502","full_name":"formix/Formix.Semaphore","owner":"formix","description":".NET Standard implementation of an awaitable semaphore.","archived":false,"fork":false,"pushed_at":"2018-09-18T22:18:28.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T04:47:32.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/formix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-08T20:32:05.000Z","updated_at":"2018-09-18T22:18:29.000Z","dependencies_parsed_at":"2023-06-17T04:16:13.875Z","dependency_job_id":null,"html_url":"https://github.com/formix/Formix.Semaphore","commit_stats":null,"previous_names":["formix/formix.synchronization"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/formix/Formix.Semaphore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2FFormix.Semaphore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2FFormix.Semaphore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2FFormix.Semaphore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2FFormix.Semaphore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formix","download_url":"https://codeload.github.com/formix/Formix.Semaphore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2FFormix.Semaphore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265383735,"owners_count":23756586,"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-11-17T09:23:55.003Z","updated_at":"2025-07-15T01:10:12.353Z","avatar_url":"https://github.com/formix.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formix.Semaphore\nIn-process .NET Standard implementation of an awaitable semaphore.\n\n# Usage\nA semaphore is an abstraction on a resource that is available in limited \nquantity. For example, you could have a subscription to an online service\nthat limits the number of simultaneous connection from your account to two.\nTo make sure you don't use more connection than you should at any time, run\nyour code using the semaphore's `Execute` method.\n\n```c#\n        var semaphore = Semaphore.Initialize(\"connections\", 2);\n\n        var task1 = semaphore.Execute(() =\u003e\n        {\n            Console.WriteLine(\"Task 1 started.\");\n            Task.Delay(250).Wait();\n            Console.WriteLine(\"Task 1 done.\");\n        });\n\n        var task2 = semaphore.Execute(() =\u003e\n        {\n            Console.WriteLine(\"Task 2 started.\");\n            Task.Delay(500).Wait();\n            Console.WriteLine(\"Task 2 done.\");\n        });\n\n        var task3 = semaphore.Execute(() =\u003e\n        {\n            Console.WriteLine(\"Task 3 started.\");\n            Task.Delay(350).Wait();\n            Console.WriteLine(\"Task 3 done.\");\n        });\n\n        Task.WaitAll(task1, task2, task3);\n```\n\nThe output should look something like that:\n\n```\nTask 1 started.\nTask 2 started.\nTask 1 done.\nTask 3 started.\nTask 2 done.\nTask 3 done.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Fformix.semaphore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformix%2Fformix.semaphore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Fformix.semaphore/lists"}