{"id":23272729,"url":"https://github.com/handsomestwei/go-routine-pool","last_synced_at":"2026-04-19T07:35:22.762Z","repository":{"id":57695651,"uuid":"284661245","full_name":"handsomestWei/go-routine-pool","owner":"handsomestWei","description":"golang routine协程池，类似java的Executors","archived":false,"fork":false,"pushed_at":"2020-10-13T02:30:27.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T09:45:23.587Z","etag":null,"topics":["executor","fsm","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/handsomestWei.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":"2020-08-03T09:43:13.000Z","updated_at":"2022-06-27T15:35:59.000Z","dependencies_parsed_at":"2022-09-06T10:42:00.624Z","dependency_job_id":null,"html_url":"https://github.com/handsomestWei/go-routine-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/handsomestWei/go-routine-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-routine-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-routine-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-routine-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-routine-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handsomestWei","download_url":"https://codeload.github.com/handsomestWei/go-routine-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-routine-pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279219001,"owners_count":26128627,"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-10-16T02:00:06.019Z","response_time":53,"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":["executor","fsm","golang"],"created_at":"2024-12-19T19:18:40.549Z","updated_at":"2025-10-16T17:10:03.226Z","avatar_url":"https://github.com/handsomestWei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-routine-pool\ngolang routine协程池，包含一个简单的有限状态机。类似java的Executors\n\n# Usage\n\n使用`pool.NewPool`创建不等待的协程池\n\n```\n// 初始化协程池，指定协程数\npool := pool.NewPool(2)\nvar n int32 = 0\nfor i := 0; i \u003c 10; i++ {\n\tn := atomic.AddInt32(\u0026n, 1)\n\tpool.Submit(func() {\n\t\tfmt.Println(fmt.Sprintf(\"n=%d\", n))\n\t})\n}\n// 不用等待所有协程处理结束。直接往下处理\nfmt.Println(\"end\")\n```\n\n使用`pool.NewWaitPool`创建等待的协程池\n\n```\n// 初始化协程池，指定协程数\npool := pool.NewWaitPool(2)\nvar n int32 = 0\nfor i := 0; i \u003c 10; i++ {\n\tn := atomic.AddInt32(\u0026n, 1)\n\tpool.Submit(func() {\n\t\tfmt.Println(fmt.Sprintf(\"n=%d\", n))\n\t})\n}\n// 等待\npool.Wait()\n// 等所有协程处理结束，再继续往下处理\nfmt.Println(\"end\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandsomestwei%2Fgo-routine-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandsomestwei%2Fgo-routine-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandsomestwei%2Fgo-routine-pool/lists"}