{"id":16683025,"url":"https://github.com/hlts2/gortinep","last_synced_at":"2026-05-20T00:02:41.102Z","repository":{"id":57598323,"uuid":"160019010","full_name":"hlts2/gortinep","owner":"hlts2","description":"A goroutine pool for Go","archived":false,"fork":false,"pushed_at":"2019-02-25T01:33:20.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T08:09:30.454Z","etag":null,"topics":["go","go-library","golang","golang-library","goroutine","goroutine-pool","goroutinemanager","gortinep","hlts2","interceptor","middleware","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/hlts2.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":"2018-12-02T06:07:28.000Z","updated_at":"2019-02-25T01:33:22.000Z","dependencies_parsed_at":"2022-08-29T23:51:43.309Z","dependency_job_id":null,"html_url":"https://github.com/hlts2/gortinep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Fgortinep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Fgortinep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Fgortinep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlts2%2Fgortinep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlts2","download_url":"https://codeload.github.com/hlts2/gortinep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243401511,"owners_count":20285058,"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":["go","go-library","golang","golang-library","goroutine","goroutine-pool","goroutinemanager","gortinep","hlts2","interceptor","middleware","worker-pool"],"created_at":"2024-10-12T14:10:06.498Z","updated_at":"2025-12-30T01:43:27.663Z","avatar_url":"https://github.com/hlts2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gortinep\n\ngortinep is thinnest goroutine pool library for go application.\n\n## Requirement\n\nGo (\u003e= 1.11)\n\n## Install\n\n```\ngo get github.com/hlts2/gortinep\n```\n\n## Example\n### Basic Example\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hlts2/gortinep\"\n\t\"github.com/hlts2/gortinep/middlewares\"\n\t\"github.com/hlts2/gortinep/middlewares/logger/zap\"\n\t\"github.com/hlts2/gortinep/middlewares/recovery\"\n\t\"go.uber.org/zap\"\n)\n\nfunc main() {\n\tz := zap.NewExample()\n\n\tg := gortinep.New(\n\t\tgortinep.WithErrorChannel(make(chan error, 1)),\n\t\tgortinep.WithWorkerSize(256),\n\t\tgortinep.WithInterceptor(\n\t\t\tmiddlewares.ChainInterceptors(\n\t\t\t\tgortinep_recovery.Interceptor(\n\t\t\t\t\tfunc(p interface{}) {\n\t\t\t\t\t\tz.Info(\"recovery from panic\")\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tgortinep_zap.Interceptor(\n\t\t\t\t\tz,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t).Start(context.Background())\n\tdefer g.Stop()\n\n\tconst jobSize = 100000\n\n\tfor i := 0; i \u003c jobSize; i++ {\n\t\t// Register job.\n\t\tg.Add(func(context.Context) error {\n\t\t\tz.Info(\"finish job\")\n\t\t\treturn nil\n\t\t})\n\t}\n\n\t// Get error of job. If execution of all jobs is completed, exit Wait function.\n\tfor err := range g.Wait() {\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n\n\t// Register job again.\n\tfor i := 0; i \u003c jobSize; i++ {\n\t\tg.Add(func(context.Context) error {\n\t\t\tz.Info(\"finish job\")\n\t\t\treturn nil\n\t\t})\n\t}\n\n\tfor err := range g.Wait() {\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n}\n```\n\n### Example with no error channel option\n\n```go\nfunc main() {\n\tz := zap.NewExample()\n\n\tg := gortinep.New(\n\t\tgortinep.WithWorkerSize(256),\n\t\tgortinep.WithInterceptor(\n\t\t\tmiddlewares.ChainInterceptors(\n\t\t\t\tgortinep_recovery.Interceptor(\n\t\t\t\t\tfunc(p interface{}) {\n\t\t\t\t\t\tz.Info(\"recovery from panic\")\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tgortinep_zap.Interceptor(\n\t\t\t\t\tz,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t).Start(context.Background())\n\tdefer g.Stop()\n\n\tconst jobSize = 100000\n\n\tfor i := 0; i \u003c jobSize; i++ {\n\t\t// Register job.\n\t\tg.Add(func(context.Context) error {\n\t\t\tz.Info(\"finish job\")\n\t\t\treturn nil\n\t\t})\n\t}\n\n        // Execution of all jobs is completed, exit Wait function.\n        g.Wait()\n}\n```\n\n## TODO\n- [ ] Test Code :pray:\n\n## Author\n[hlts2](https://github.com/hlts2)\n\n## LICENSE\ngortinep released under MIT license, refer [LICENSE](https://github.com/hlts2/gortinep/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlts2%2Fgortinep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlts2%2Fgortinep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlts2%2Fgortinep/lists"}