{"id":21476071,"url":"https://github.com/mehditeymorian/koi","last_synced_at":"2025-07-11T14:37:36.975Z","repository":{"id":37701792,"uuid":"505698362","full_name":"mehditeymorian/koi","owner":"mehditeymorian","description":"Goroutine and Worker Manager","archived":false,"fork":false,"pushed_at":"2022-10-15T08:57:13.000Z","size":69,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T02:21:43.599Z","etag":null,"topics":["concurrency","golang","goroutine","goroutine-pool","goroutinemanager","pool-manager","synchronization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehditeymorian.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":"2022-06-21T05:11:06.000Z","updated_at":"2023-06-29T10:05:36.000Z","dependencies_parsed_at":"2022-09-14T13:11:28.666Z","dependency_job_id":null,"html_url":"https://github.com/mehditeymorian/koi","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mehditeymorian/koi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehditeymorian%2Fkoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehditeymorian%2Fkoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehditeymorian%2Fkoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehditeymorian%2Fkoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehditeymorian","download_url":"https://codeload.github.com/mehditeymorian/koi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehditeymorian%2Fkoi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264833291,"owners_count":23670617,"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":["concurrency","golang","goroutine","goroutine-pool","goroutinemanager","pool-manager","synchronization"],"created_at":"2024-11-23T10:47:07.976Z","updated_at":"2025-07-11T14:37:36.774Z","avatar_url":"https://github.com/mehditeymorian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\u003cimg alt=\"Koi logo\" src=\"asset/logo.webp\" width=\"500px\"/\u003e\u003cbr/\u003e\nKOI\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003eGoroutine and Worker Manager\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/mehditeymorian/koi/v3?tab=doc\"target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Go-1.18+-00ADD8?style=for-the-badge\u0026logo=go\" alt=\"go version\" /\u003e\n\u003c/a\u003e\u0026nbsp;\n\u003cimg src=\"https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge\u0026logo=none\" alt=\"license\" /\u003e\n\n\u003cimg src=\"https://img.shields.io/badge/Version-1.0.1-informational?style=for-the-badge\u0026logo=none\" alt=\"version\" /\u003e\n\u003c/p\u003e\n\n# Installation\n```bash\ngo get github.com/mehditeymorian/koi\n```\n\n# Usage\n```Go\n// create a pond \npond := koi.NewPond()\n\n// create a worker\nworker := koi.Worker{\n    ConcurrentCount: CONCURRENT_RUNNING_GOROUTINE_FOR_THIS_WORKER,\n    QueueSize:       REQUEST_QUEUE_SIZE,\n    Work: func(a any) any {\n        // do some work\n        return RESULT\n    },\n}\n\n// register worker to a unique id\nerr = pond.RegisterWorker(\"workerID\", worker)\n\n// add job to worker\n// this is non-blocking unless the queue is full.\nresultChan, err := pond.AddWork(\"workerID\", requestData)\n\n// read results from worker\nfor res := range resultChan {\n    // do something with result\n}  \n```\n**Note**: `pond.AddJob` is non-blocking unless worker queue is full.\n\n\n# Terminology\n- **Koi**: Koi is an informal name for the colored variants of C. rubrofuscus kept for ornamental purposes.\n- **Pond**: an area of water smaller than a lake, often artificially made.\n\n# Generic Version of KOI\n- [Generic KOI](https://github.com/1995parham/koi) written by [Parham](https://github.com/1995parham)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehditeymorian%2Fkoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehditeymorian%2Fkoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehditeymorian%2Fkoi/lists"}