{"id":16443460,"url":"https://github.com/sherifabdlnaby/semaphore","last_synced_at":"2025-08-30T12:13:41.818Z","repository":{"id":57491695,"uuid":"166173919","full_name":"sherifabdlnaby/semaphore","owner":"sherifabdlnaby","description":"A fork of golang/x/sync/semaphore that is also resizable in runtime.","archived":false,"fork":false,"pushed_at":"2019-03-04T01:00:23.000Z","size":45,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T04:32:05.961Z","etag":null,"topics":["go","resizable","semaphore","semaphore-pattern"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sherifabdlnaby.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":"2019-01-17T06:39:09.000Z","updated_at":"2023-05-23T02:40:40.000Z","dependencies_parsed_at":"2022-08-30T23:22:17.748Z","dependency_job_id":null,"html_url":"https://github.com/sherifabdlnaby/semaphore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sherifabdlnaby/semaphore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifabdlnaby%2Fsemaphore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifabdlnaby%2Fsemaphore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifabdlnaby%2Fsemaphore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifabdlnaby%2Fsemaphore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sherifabdlnaby","download_url":"https://codeload.github.com/sherifabdlnaby/semaphore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifabdlnaby%2Fsemaphore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272847020,"owners_count":25003115,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","resizable","semaphore","semaphore-pattern"],"created_at":"2024-10-11T09:20:35.361Z","updated_at":"2025-08-30T12:13:41.800Z","avatar_url":"https://github.com/sherifabdlnaby.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semaphore\n\n[![](https://godoc.org/github.com/sherifabdlnaby/semaphore?status.svg)](http://godoc.org/github.com/sherifabdlnaby/semaphore)\n[![Build Status](https://travis-ci.org/sherifabdlnaby/semaphore.svg?branch=master)](https://travis-ci.org/sherifabdlnaby/semaphore)\n[![codecov](https://codecov.io/gh/Sherifabdlnaby/semaphore/branch/resizable-semaphore/graph/badge.svg)](https://codecov.io/gh/Sherifabdlnaby/semaphore)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nA fork of `golang/x/sync/semaphore` that is also **resizable**.\n\n----\n\nThis fork adds the ability to resize the semaphore in a concurrent-safe way.\n\n- Use `semaphore.Resize(N)` to resize the semaphore to a new absolute value `N`\n- #### Example\n    ```go\n    sem := semaphore.NewWeighted(5)     // Semaphore size = 5\n    result1 := sem.TryAcquire(10)       // returns false.\n    sem.Resize(15)                      // Semaphore size now = 10\n    result2 := sem.TryAcquire(10)       // returns true.\n    fmt.Println(result1,result2)        // prints false \\n true  \n    ```\n- Added resize functionality has **no impact on the semaphore performance** according to benchmarks.\n- Tests for the newly added `Resize()` was also added.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherifabdlnaby%2Fsemaphore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherifabdlnaby%2Fsemaphore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherifabdlnaby%2Fsemaphore/lists"}