{"id":13397074,"url":"https://github.com/gammazero/workerpool","last_synced_at":"2026-02-14T21:09:09.964Z","repository":{"id":37271177,"uuid":"59030162","full_name":"gammazero/workerpool","owner":"gammazero","description":"Concurrency limiting goroutine pool","archived":false,"fork":false,"pushed_at":"2025-02-13T21:11:40.000Z","size":88,"stargazers_count":1380,"open_issues_count":21,"forks_count":141,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-11T05:45:46.045Z","etag":null,"topics":["concurrency","worker-pool"],"latest_commit_sha":null,"homepage":null,"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/gammazero.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":"2016-05-17T14:32:06.000Z","updated_at":"2025-05-10T01:19:58.000Z","dependencies_parsed_at":"2024-09-21T05:01:55.941Z","dependency_job_id":"730b31ae-db0d-4893-b16f-3d59ea2e449e","html_url":"https://github.com/gammazero/workerpool","commit_stats":{"total_commits":81,"total_committers":9,"mean_commits":9.0,"dds":0.3950617283950617,"last_synced_commit":"04acb162faed9f1c3180837ce712cb8c1654531c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammazero%2Fworkerpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammazero%2Fworkerpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammazero%2Fworkerpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammazero%2Fworkerpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gammazero","download_url":"https://codeload.github.com/gammazero/workerpool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523720,"owners_count":21921818,"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":["concurrency","worker-pool"],"created_at":"2024-07-30T18:01:10.558Z","updated_at":"2026-02-14T21:09:09.958Z","avatar_url":"https://github.com/gammazero.png","language":"Go","funding_links":[],"categories":["Go","开源类库","Goroutines","\u003cspan id=\"协程-Coroutines\"\u003e协程 Coroutines\u003c/span\u003e","Goroutines `goroutines的管理和使用`","Programming","Relational Databases"],"sub_categories":["协程/线程","Advanced Console UIs","检索及分析资料库","Search and Analytic Databases","SQL 查询语句构建库","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Go"],"readme":"# workerpool\n\n[![GoDoc](https://pkg.go.dev/badge/github.com/gammazero/workerpool)](https://pkg.go.dev/github.com/gammazero/workerpool)\n[![Build Status](https://github.com/gammazero/workerpool/actions/workflows/go.yml/badge.svg)](https://github.com/gammazero/workerpool/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gammazero/workerpool)](https://goreportcard.com/report/github.com/gammazero/workerpool)\n[![codecov](https://codecov.io/gh/gammazero/workerpool/branch/master/graph/badge.svg)](https://codecov.io/gh/gammazero/workerpool)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/gammazero/workerpool/blob/master/LICENSE)\n\nConcurrency limiting goroutine pool. Limits the concurrency of task execution, not the number of tasks queued. Never blocks submitting tasks, no matter how many tasks are queued.\n\nIf you need a worker pool that blocks when all workers are busy, see [workers](https://github.com/gammazero/workers).\n\nThis implementation builds on ideas from the following:\n\n- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang\n- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html\n\n## Installation\n\nTo install this package, you need to setup your Go workspace. The simplest way to install the library is to run:\n```\n$ go get github.com/gammazero/workerpool\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/gammazero/workerpool\"\n)\n\nfunc main() {\n\twp := workerpool.New(2)\n\trequests := []string{\"alpha\", \"beta\", \"gamma\", \"delta\", \"epsilon\"}\n\n\tfor _, r := range requests {\n\t\twp.Submit(func() {\n\t\t\tfmt.Println(\"Handling request:\", r)\n\t\t})\n\t}\n\n\twp.StopWait()\n}\n```\n\n[Example wrapper function](https://go.dev/play/p/BWnRhJYarZ1) to show start and finish time of submitted function.\n\n## Usage Note\n\nThere is no upper limit on the number of tasks queued, other than the limits of system resources. If the number of inbound tasks is too many to even queue for pending processing, then the solution is outside the scope of workerpool. It should be solved by distributing workload over multiple systems, and/or storing input for pending processing in intermediate storage such as a file system, distributed message queue, etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgammazero%2Fworkerpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgammazero%2Fworkerpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgammazero%2Fworkerpool/lists"}