{"id":37141477,"url":"https://github.com/simpleapples/cyclone","last_synced_at":"2026-01-14T16:36:28.459Z","repository":{"id":57560977,"uuid":"178191323","full_name":"simpleapples/cyclone","owner":"simpleapples","description":"A goroutine pool - allow you limit number of goroutines, especially in cpu heavy load","archived":false,"fork":false,"pushed_at":"2022-01-20T10:04:23.000Z","size":10,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T11:56:27.642Z","etag":null,"topics":["go","golang","goroutine","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/simpleapples.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":"2019-03-28T11:39:40.000Z","updated_at":"2022-02-02T05:29:16.000Z","dependencies_parsed_at":"2022-09-01T12:21:25.372Z","dependency_job_id":null,"html_url":"https://github.com/simpleapples/cyclone","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simpleapples/cyclone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simpleapples%2Fcyclone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simpleapples%2Fcyclone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simpleapples%2Fcyclone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simpleapples%2Fcyclone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simpleapples","download_url":"https://codeload.github.com/simpleapples/cyclone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simpleapples%2Fcyclone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:32:27.303Z","status":"ssl_error","status_checked_at":"2026-01-14T16:28:36.419Z","response_time":107,"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":["go","golang","goroutine","pool"],"created_at":"2026-01-14T16:36:27.526Z","updated_at":"2026-01-14T16:36:28.455Z","avatar_url":"https://github.com/simpleapples.png","language":"Go","readme":"## Cyclone\n\n[![goreportcard for simpleapples/cyclone][1]][2]\n[![License: MIT][3]][4]\n\nCyclone is a go package to spawn, reuse and manage a number of goroutines.\n\n## Install\n\nGo Get:\n\n``` sh\ngo get github.com/simpleapples/cyclone\n```\n\nDep:\n\n``` sh\ndep ensure -add github.com/simpleapples/cyclone\n```\n\n## Examples\n\n```go\nsize := runtime.NumCPU()\npool := NewWithClosure(int64(size), func(payload interface{}) interface{} {\n    intV := payload.(int)\n    fmt.Println(intV)\n    return intV\n})\ndefer pool.Close()\n\nfor i := 0; i \u003c size; i++ {\n    _, err := pool.Run(i)\n}\n```\nParallel jobs:\n\n```go\nsize := 5\ntotal := 20\n\nwg := sync.WaitGroup{}\n\npool := NewWithCallback(int64(size), func(payload interface{}) interface{} {\n    intV := payload.(int)\n    time.Sleep(1 * time.Second)\n    return intV\n}, func(result interface{}) {\n    intV := result.(int)\n    fmt.Println(intV)\n    wg.Done()\n})\n\nfor i := 0; i \u003c total; i++ {\n    wg.Add(1)\n    pool.Run(i)\n}\nwg.Wait()\n```\n\nChange pool size:\n\n```go\npool.SetSize(100)\npool.SetSize(10000)\n```\n\n[1]: https://goreportcard.com/badge/github.com/simpleapples/cyclone\n[2]: https://goreportcard.com/report/simpleapples/cyclone\n[3]: https://img.shields.io/badge/License-MIT-blue.svg\n[4]: https://opensource.org/licenses/MIT\n[5]: https://img.shields.io/badge/license-NPL%20(The%20996%20Prohibited%20License)-blue.svg\n[6]: https://github.com/996icu/996.ICU/blob/master/LICENSE\n[7]: https://img.shields.io/badge/link-996.icu-red.svg\n[8]: https://996.icu\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimpleapples%2Fcyclone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimpleapples%2Fcyclone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimpleapples%2Fcyclone/lists"}