{"id":43041550,"url":"https://github.com/spiretechnology/go-pool","last_synced_at":"2026-01-31T09:13:56.582Z","repository":{"id":57631502,"uuid":"410170193","full_name":"spiretechnology/go-pool","owner":"spiretechnology","description":"A Go library for goroutine worker pools","archived":false,"fork":false,"pushed_at":"2021-09-25T04:07:58.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-27T22:38:28.088Z","etag":null,"topics":["concurrency","golang","goroutines","worker-pool"],"latest_commit_sha":null,"homepage":"","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/spiretechnology.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":"2021-09-25T04:00:37.000Z","updated_at":"2023-02-08T17:59:47.000Z","dependencies_parsed_at":"2022-09-04T22:32:41.566Z","dependency_job_id":null,"html_url":"https://github.com/spiretechnology/go-pool","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/spiretechnology/go-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiretechnology%2Fgo-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiretechnology%2Fgo-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiretechnology%2Fgo-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiretechnology%2Fgo-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spiretechnology","download_url":"https://codeload.github.com/spiretechnology/go-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiretechnology%2Fgo-pool/sbom","scorecard":{"id":841669,"data":{"date":"2025-08-11","repo":{"name":"github.com/spiretechnology/go-pool","commit":"a6b3c4edac01527d1546a67007e8862ac3390664"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T20:37:14.308Z","repository_id":57631502,"created_at":"2025-08-23T20:37:14.308Z","updated_at":"2025-08-23T20:37:14.308Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28936100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["concurrency","golang","goroutines","worker-pool"],"created_at":"2026-01-31T09:13:53.020Z","updated_at":"2026-01-31T09:13:56.577Z","avatar_url":"https://github.com/spiretechnology.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-pool\n\nA Go library for goroutine pools.\n\n## Installation\n\n```bash\ngo get github.com/spiretechnology/go-pool\n```\n\n## Problem\n\nA common pattern in Go is to split up work into `N` parallel goroutines:\n\n```go\n// Create wait group so we can wait for all work to finish\nvar wg sync.WaitGroup\nwg.Add(len(jobs))\n\n// Loop through all the jobs that need to be done\nfor _, job := range jobs {\n    job := job\n    go func() {\n        defer wg.Done()\n        job()\n    }()\n}\n\n// Wait for all jobs to finish\nwg.Wait()\n```\n\nThis is a great and extremely useful pattern. However, there is a downside to this pattern. As the number of jobs `N` increases, the number of active goroutines increases, reducing the resources available to other concurrent users of your application.\n\nIn systems handling many concurrent requests, long-running work spawning thousands of goroutines can cause slow response times for other clients who have simpler requests.\n\n## Solution\n\nThis library provides a simple solution: **goroutine pools**. Instead of launching `N` goroutines for an input of that size, goroutine pools allow you to launch `min(N, limit)` where the `limit` value caps resource utilization.\n\n```go\n// Create a new worker pool\np := pool.New(5)\n\n// Loop through the jobs that need to be done\nfor _, job := range jobs {\n    job := job\n    p.Go(func() {\n        // Run the job\n        job()\n    })\n}\n\n// Wait for all jobs to finish\np.Wait()\n```\n\nThis works *nearly* identically to the prior example, but the number of simultaneous goroutines spawned is limited to `5` instead of being infinite. If there are millions of jobs, they will be executed only 5 at a time, slowing down the runtime of *this* code but keeping resources available for other parts of the application.\n\n## Priority vs magic numbers\n\nThe pattern of creating worker pools with a hard-coded maximum (such as `pool.New(5)`) is not usually ideal, as it doesn't scale with the amount of available resources.\n\nBecause of this, there are a few built-in functions that are preferred:\n\n```go\n// Creates a pool with a maximum number of goroutines equal to the number\n// of CPUs on the machine\npool.Default()\npool.WithPriority(pool.NORMAL)\n\n// Creates a pool with a HIGH priority, which allows many times more goroutines to\n// be scheduled than the number of CPUs\npool.WithPriority(pool.HIGH)\n\n// Creates a pool with a LOW priority, which allows only a fraction of the number of \n// goroutines to be scheduled simultaneously.\npool.WithPriority(pool.LOW)\n```\n\n## Concluding notes\n\nThe Go runtime does a great job scheduling goroutines, but it has no concept of how we, as the systems engineers, want to prioritize concurrent tasks. Here's an example:\n\nOn a highly concurrent API server, some requests may spawn thousands of goroutines, and some requests may spawn only a handful or less. If these requests are received simultaneously, the larger one may dramatically slow down the response time for the smaller request by choking it of resources.\n\nUsing goroutine pools (this library) we're able to throttle down the larger tasks so all clients can have their requests fulfilled in a reasonable time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiretechnology%2Fgo-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiretechnology%2Fgo-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiretechnology%2Fgo-pool/lists"}