{"id":17954353,"url":"https://github.com/txthinking/runnergroup","last_synced_at":"2025-05-08T04:22:37.445Z","repository":{"id":48088770,"uuid":"248955705","full_name":"txthinking/runnergroup","owner":"txthinking","description":"RunnerGroup is like sync.WaitGroup, the diffrence is if one task stops, all will be stopped.","archived":false,"fork":false,"pushed_at":"2025-02-24T02:13:07.000Z","size":20,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T17:07:22.188Z","etag":null,"topics":["blocking","golang","goroutine","server","sync","waitgroup"],"latest_commit_sha":null,"homepage":"https://www.txthinking.com","language":"Go","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/txthinking.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":"2020-03-21T10:46:07.000Z","updated_at":"2025-02-25T04:54:46.000Z","dependencies_parsed_at":"2024-06-18T18:40:09.741Z","dependency_job_id":"beff4077-197e-49c2-b6aa-480643a64bcd","html_url":"https://github.com/txthinking/runnergroup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txthinking%2Frunnergroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txthinking%2Frunnergroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txthinking%2Frunnergroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txthinking%2Frunnergroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txthinking","download_url":"https://codeload.github.com/txthinking/runnergroup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252997579,"owners_count":21837839,"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":["blocking","golang","goroutine","server","sync","waitgroup"],"created_at":"2024-10-29T10:14:18.769Z","updated_at":"2025-05-08T04:22:37.418Z","avatar_url":"https://github.com/txthinking.png","language":"Go","readme":"## RunnerGroup\n\n[![GoDoc](https://img.shields.io/badge/Go-Doc-blue.svg)](https://godoc.org/github.com/txthinking/runnergroup)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/txthinking/runnergroup/blob/master/LICENSE)\n\nRunnerGroup is like [sync.WaitGroup](https://pkg.go.dev/sync?tab=doc#WaitGroup), the diffrence is if one task stops, all will be stopped.\n\n❤️ A project by [txthinking.com](https://www.txthinking.com)\n\n### Install\n\n    $ go get github.com/txthinking/runnergroup\n\n### Example\n\n```\nimport (\n\t\"context\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/txthinking/runnergroup\"\n)\n\nfunc Example() {\n\tg := runnergroup.New()\n\n\ts := \u0026http.Server{\n\t\tAddr: \":9991\",\n\t}\n\tg.Add(\u0026runnergroup.Runner{\n\t\tStart: func() error {\n\t\t\treturn s.ListenAndServe()\n\t\t},\n\t\tStop: func() error {\n\t\t\treturn s.Shutdown(context.Background())\n\t\t},\n\t})\n\n\ts1 := \u0026http.Server{\n\t\tAddr: \":9992\",\n\t}\n\tg.Add(\u0026runnergroup.Runner{\n\t\tStart: func() error {\n\t\t\treturn s1.ListenAndServe()\n\t\t},\n\t\tStop: func() error {\n\t\t\treturn s1.Shutdown(context.Background())\n\t\t},\n\t})\n\n\tgo func() {\n\t\ttime.Sleep(5 * time.Second)\n\t\tlog.Println(g.Done())\n\t}()\n\tlog.Println(g.Wait())\n\t// Output:\n}\n\n```\n\n## License\n\nLicensed under The MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxthinking%2Frunnergroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxthinking%2Frunnergroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxthinking%2Frunnergroup/lists"}