{"id":13413066,"url":"https://github.com/loveleshsharma/gohive","last_synced_at":"2026-01-18T05:00:06.287Z","repository":{"id":37463884,"uuid":"189577717","full_name":"loveleshsharma/gohive","owner":"loveleshsharma","description":"🐝 A Highly Performant and easy to use goroutine pool for Go","archived":false,"fork":false,"pushed_at":"2023-11-19T05:43:55.000Z","size":191,"stargazers_count":52,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-31T20:51:54.230Z","etag":null,"topics":["async","asynchronous-tasks","concurren","go","goroutine","goroutine-pool","goroutine-scheduling","pool","task-queue","task-scheduler"],"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/loveleshsharma.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}},"created_at":"2019-05-31T10:44:24.000Z","updated_at":"2024-06-01T00:04:00.000Z","dependencies_parsed_at":"2024-01-08T15:34:36.474Z","dependency_job_id":null,"html_url":"https://github.com/loveleshsharma/gohive","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.2666666666666667,"last_synced_commit":"7eec91c929938fd5bea1b7c794829f9716465617"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loveleshsharma/gohive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveleshsharma%2Fgohive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveleshsharma%2Fgohive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveleshsharma%2Fgohive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveleshsharma%2Fgohive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loveleshsharma","download_url":"https://codeload.github.com/loveleshsharma/gohive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveleshsharma%2Fgohive/sbom","scorecard":{"id":600091,"data":{"date":"2025-08-11","repo":{"name":"github.com/loveleshsharma/gohive","commit":"f98e85308c6f48917c650ca7044a9a5a686fe142"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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-21T00:11:44.403Z","repository_id":37463884,"created_at":"2025-08-21T00:11:44.403Z","updated_at":"2025-08-21T00:11:44.403Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28530606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["async","asynchronous-tasks","concurren","go","goroutine","goroutine-pool","goroutine-scheduling","pool","task-queue","task-scheduler"],"created_at":"2024-07-30T20:01:33.030Z","updated_at":"2026-01-18T05:00:06.159Z","avatar_url":"https://github.com/loveleshsharma.png","language":"Go","funding_links":[],"categories":["Goroutines","Relational Databases","Goroutines `goroutines的管理和使用`"],"sub_categories":["Search and Analytic Databases","Advanced Console UIs","检索及分析资料库","SQL 查询语句构建库"],"readme":"\u003cp align=\"center\"\u003e \n    \u003cimg width=\"150\" height=\"150\" src=\"internal/static/GoHiveIcon.png\" alt=\"\"\u003e\n    \u003ch1 align=\"center\"\u003egohive\u003c/h1\u003e\n    \u003cp align=\"center\"\u003ePackage gohive implements a simple and easy to use goroutine pool for Go\u003cp\u003e\n    \u003cp align=\"center\"\u003e\u003ca href=\"https://travis-ci.org/loveleshsharma/gohive\"\u003e\u003cimg src=\"https://travis-ci.org/loveleshsharma/gohive.svg?branch=master\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/loveleshsharma/gohive\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/loveleshsharma/gohive\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/loveleshsharma/gohive\"\u003e\u003cimg src=\"https://codecov.io/gh/loveleshsharma/gohive/branch/master/graph/badge.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://godoc.org/github.com/loveleshsharma/gohive\"\u003e\u003cimg src=\"https://godoc.org/github.com/loveleshsharma/gohive?status.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/avelino/awesome-go#goroutines\"\u003e\u003cimg src=\"https://awesome.re/mentioned-badge.svg\" /\u003e\u003c/a\u003e\n    \u003c/p\u003e\n\u003c/p\u003e\n\n## Features\n\n- Pool can be created with a specific size as per the requirement\n- Accepts tasks which implements Runner interface\n- Uses channels to accepts tasks and gets them executed via workers\n- Uses synchronization among workers to avoid race conditions\n\n## Installation\nUse ```go get``` to install and update:\n```go\n$ go get -u github.com/loveleshsharma/gohive\n```\n\n## Usage\n\n- Create an instance of Pool type first\n\n```go\nhive := gohive.NewFixedPool(5)\n```\n\n- Invoke the Submit() function and pass the task to execute\n\n```go\nhive.Submit(object Runner)\n```\nSubmit function accepts a Runner object as an argument, which it passes to the pool if a worker is available, otherwise it will wait for the worker to be available\n\n- To close the pool we can invoke the Close() function\n\n```go\nhive.Close()\n```\nOnce the pool is closed, we cannot assign any task to it\n\n## Example\n\nLet's get into a full program where we can see how to use the gohive package in order to execute many goroutines simultaneously\n\n```go\npackage main\n\nimport (\n   \"fmt\"\n   \"github.com/loveleshsharma/gohive\"\n   \"sync\"\n)\n\nfunc main() {\n   var wg sync.WaitGroup\n   pool := gohive.NewFixedPool(5)\n\n   for i := 1; i \u003c= 20; i++ {\n      if err := pool.Submit(NewMyStruct(i, \u0026wg)); err != nil {\n         fmt.Println(\"error: \", err)\n         break\n      }\n   }\n\n   wg.Wait()\n}\n\ntype MyStruct struct {\n   num int\n   wg  *sync.WaitGroup\n}\n\nfunc NewMyStruct(num int, wg *sync.WaitGroup) MyStruct {\n   myStruct := MyStruct{\n      num: num,\n      wg:  wg,\n   }\n   wg.Add(1)\n   return myStruct\n}\n\nfunc (s MyStruct) Run() {\n   defer s.wg.Done()\n   val := s.num\n   fact := s.num\n   for i := s.num - 1; i \u003e 0; i-- {\n      fact *= i\n   }\n\n   fmt.Printf(\"Factorial of %d: %d\\n\", val, fact)\n}\n\n\n```\n\u003cB\u003eImportant : \u003c/B\u003e Always keep sync.WaitGroup in your struct and put ```defer wg.Done()``` as the first statement of your Run() function. It will wait for your task to complete.\n\n###\nTODO\n1. Maintain a waiting queue to stop blocking submit method when all goroutines are busy.\n2. Submitting priority tasks which takes priority over other tasks.\n3. Handling panics inside goroutines to prevent them from crashing.\n4. Implement dynamic pool which will scale the number of goroutines as per requirement and scales down when they are idle.\n5. Submitting multiple tasks together.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floveleshsharma%2Fgohive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floveleshsharma%2Fgohive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floveleshsharma%2Fgohive/lists"}