{"id":30930298,"url":"https://github.com/peteryangs/waittree","last_synced_at":"2025-09-10T10:44:20.267Z","repository":{"id":57646114,"uuid":"441699662","full_name":"PeterYangs/waitTree","owner":"PeterYangs","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-10T05:47:41.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T10:05:03.419Z","etag":null,"topics":[],"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/PeterYangs.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}},"created_at":"2021-12-25T14:50:38.000Z","updated_at":"2024-06-20T10:05:03.420Z","dependencies_parsed_at":"2022-09-08T15:11:52.161Z","dependency_job_id":null,"html_url":"https://github.com/PeterYangs/waitTree","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/PeterYangs/waitTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FwaitTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FwaitTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FwaitTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FwaitTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterYangs","download_url":"https://codeload.github.com/PeterYangs/waitTree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FwaitTree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274448149,"owners_count":25287120,"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-09-10T02:00:12.551Z","response_time":83,"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":[],"created_at":"2025-09-10T10:44:18.943Z","updated_at":"2025-09-10T10:44:20.251Z","avatar_url":"https://github.com/PeterYangs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/waitTree\"\n\t\"time\"\n)\n\nfunc main() {\n\n\tfather := waitTree.NewWaitTree(waitTree.Background())\n\n\tson := waitTree.NewWaitTree(father)\n\tson2 := waitTree.NewWaitTree(father)\n\n\tfor i := 0; i \u003c 10; i++ {\n\n\t\tson.Add(1)\n\n\t\tgo func() {\n\n\t\t\tdefer func() {\n\n\t\t\t\tson.Done()\n\n\t\t\t\t//从父类中释放\n\t\t\t\tson.Release()\n\t\t\t}()\n\n\t\t\ttime.Sleep(1 * time.Second)\n\n\t\t\tfmt.Println(\"son done\")\n\n\t\t}()\n\n\t}\n\n\tfor i := 0; i \u003c 10; i++ {\n\n\t\tson2.Add(1)\n\n\t\tgo func() {\n\n\t\t\tdefer func() {\n\n\t\t\t\tson2.Done()\n\n\t\t\t\t//从父类中释放\n\t\t\t\tson2.Release()\n\t\t\t}()\n\n\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\tfmt.Println(\"son2 done\")\n\n\t\t}()\n\n\t}\n\n\tfather.Wait()\n\n\tfather.Wait()\n\n\t//释放所有子wait\n\t//father.ReleaseSon()\n\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteryangs%2Fwaittree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeteryangs%2Fwaittree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteryangs%2Fwaittree/lists"}