{"id":23975252,"url":"https://github.com/arussellsaw/signalgroup","last_synced_at":"2025-07-16T08:45:53.366Z","repository":{"id":72507822,"uuid":"206163788","full_name":"arussellsaw/signalgroup","owner":"arussellsaw","description":"a library for handling broadcasting data to groups of goroutines, with deterministic ordering","archived":false,"fork":false,"pushed_at":"2019-09-03T21:29:46.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T14:02:52.398Z","etag":null,"topics":["broadcast","concurrency","goroutine","signal","waitgroup"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arussellsaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-09-03T20:11:12.000Z","updated_at":"2019-09-04T20:06:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"f578fbee-036e-472d-90c0-c7bd90808916","html_url":"https://github.com/arussellsaw/signalgroup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arussellsaw/signalgroup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arussellsaw%2Fsignalgroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arussellsaw%2Fsignalgroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arussellsaw%2Fsignalgroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arussellsaw%2Fsignalgroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arussellsaw","download_url":"https://codeload.github.com/arussellsaw/signalgroup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arussellsaw%2Fsignalgroup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265497986,"owners_count":23777093,"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":["broadcast","concurrency","goroutine","signal","waitgroup"],"created_at":"2025-01-07T06:00:12.163Z","updated_at":"2025-07-16T08:45:53.361Z","avatar_url":"https://github.com/arussellsaw.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# signalgroup\n\n[![](https://godoc.org/github.com/arussellsaw/signalgroup?status.svg)](http://godoc.org/github.com/arussellsaw/signalgroup)\n\nThis library provides a basic tool for broadcasting data to an arbitrary number of goroutines, with minimal blocking on the send side, and deterministic ordering for recievers. Under the hood the library uses a linked list of channels that are closed to unblock when data is ready to be recieved. this allows us to repeatedly add signals to be recieved, even if consumers are slow to unblock and consume.\n\nAs a tradeoff there's a slightly inconvenient API, where you are given a new cursor handle after every wait call, here is an example of the group in action:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/arussellsaw/signalgroup\"\n)\n\nfunc main() {\n\tg := signalgroup.New()\n\tvar wg sync.WaitGroup\n\tfor i := 0; i \u003c 10; i++ {\n\t\twg.Add(1)\n\t\tgo worker(g.Cursor(), \u0026wg)\n\t}\n\tfor i := 0; i \u003c 10; i++ {\n\t\tfmt.Println(\"sending\", i)\n\t\tg.Send(i)\n\t}\n\twg.Wait()\n}\n\nfunc worker(c *signalgroup.Cursor, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tvar s interface{}\n\tfor {\n\t\tc, s = c.Wait()\n\t\tfmt.Println(\"got\", s)\n\t\tv := s.(int)\n\t\tif v == 9 {\n\t\t\treturn\n\t\t}\n\t}\n}\n```\n\n## codegen\nthis lib uses `interface{}` for ease of use, but would be a great candidate for code generation to have typed signalgroups, i might work on this if i get bored but i welcome contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farussellsaw%2Fsignalgroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farussellsaw%2Fsignalgroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farussellsaw%2Fsignalgroup/lists"}