{"id":41843644,"url":"https://github.com/kunaltaitkar/goworkerpool","last_synced_at":"2026-01-25T09:41:31.440Z","repository":{"id":83041232,"uuid":"213206317","full_name":"kunaltaitkar/goworkerpool","owner":"kunaltaitkar","description":"go pool of concurrent workers with the ability to add / kill workers on demand","archived":false,"fork":false,"pushed_at":"2020-01-28T17:12:26.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T03:29:09.306Z","etag":null,"topics":["channels","concurrency","go","golang","goroutines","workerpool"],"latest_commit_sha":null,"homepage":"","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/kunaltaitkar.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-06T16:49:14.000Z","updated_at":"2023-03-04T09:56:10.000Z","dependencies_parsed_at":"2023-05-21T07:00:15.209Z","dependency_job_id":null,"html_url":"https://github.com/kunaltaitkar/goworkerpool","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kunaltaitkar/goworkerpool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaltaitkar%2Fgoworkerpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaltaitkar%2Fgoworkerpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaltaitkar%2Fgoworkerpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaltaitkar%2Fgoworkerpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunaltaitkar","download_url":"https://codeload.github.com/kunaltaitkar/goworkerpool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaltaitkar%2Fgoworkerpool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28750900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:00:19.176Z","status":"ssl_error","status_checked_at":"2026-01-25T09:00:04.131Z","response_time":113,"last_error":"SSL_read: 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":["channels","concurrency","go","golang","goroutines","workerpool"],"created_at":"2026-01-25T09:41:31.331Z","updated_at":"2026-01-25T09:41:31.434Z","avatar_url":"https://github.com/kunaltaitkar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Workerpool-withCancellableContext**\n\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\t\"goworkerpool/workerpool\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar count int\nvar countMutex = \u0026sync.Mutex{}\n\nfunc main() {\n\n\tcount = 0\n\n\t// preparing tasks\n\ttasks := []*workerpool.Task{}\n\n\tfor index := 0; index \u003c 1000; index++ {\n\t\ttasks = append(tasks, workerpool.NewTask(index, incrementCount))\n\t}\n\n\t//initialize pool\n\tpool := workerpool.NewPoolWithContext(tasks, 10)\n\n\t// to check count value\n\tticker := time.NewTicker(1 * time.Millisecond)\n\n\t// cancel all workers when count is more than 500\n\tgo func() {\n\t\tfor range ticker.C {\n\t\t\tif count \u003e 500 {\n\t\t\t\tfmt.Println(\"cancelling tasks...\")\n\t\t\t\tpool.Cancel()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\t// run pool\n\tpool.Run()\n\n\ttime.Sleep(10 * time.Second)\n}\n\n//incrementCount- increment count by 1\nfunc incrementCount(data interface{}) error {\n\n\tcountMutex.Lock()\n\tcount++\n\tcountMutex.Unlock()\n\n\treturn nil\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunaltaitkar%2Fgoworkerpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunaltaitkar%2Fgoworkerpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunaltaitkar%2Fgoworkerpool/lists"}