{"id":36892013,"url":"https://github.com/kaatinga/luna","last_synced_at":"2026-01-12T15:38:21.095Z","repository":{"id":190616516,"uuid":"655418884","full_name":"kaatinga/luna","owner":"kaatinga","description":"thread safe worker pool","archived":false,"fork":false,"pushed_at":"2024-07-06T20:50:25.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-06T21:47:36.443Z","etag":null,"topics":["help-wanted","thread-safe","worker","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/kaatinga.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":"supported_types.go","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-18T20:43:02.000Z","updated_at":"2024-07-06T20:50:28.000Z","dependencies_parsed_at":"2024-04-15T22:30:52.378Z","dependency_job_id":"0253e2cf-a0c9-4cba-a3f1-632f3039bc0b","html_url":"https://github.com/kaatinga/luna","commit_stats":null,"previous_names":["kaatinga/luna"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaatinga/luna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Fluna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Fluna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Fluna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Fluna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaatinga","download_url":"https://codeload.github.com/kaatinga/luna/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaatinga%2Fluna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["help-wanted","thread-safe","worker","worker-pool"],"created_at":"2026-01-12T15:38:16.429Z","updated_at":"2026-01-12T15:38:21.084Z","avatar_url":"https://github.com/kaatinga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://github.com/kaatinga/luna/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/kaatinga/luna/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/kaatinga/luna/graph/badge.svg?token=277RYDJB2J)](https://codecov.io/gh/kaatinga/luna)\n[![lint workflow](https://github.com/kaatinga/luna/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/luna/luna/actions?query=workflow%3Alinter)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/kaatinga/luna/blob/main/LICENSE)\n[![help wanted](https://img.shields.io/badge/Help%20wanted-True-yellow.svg)](https://github.com/luna/strconv/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)\n\n# Luna\n\nLuna is a flexible and generic worker pool implementation in Go, designed to manage and orchestrate workers efficiently. It supports generic types for keys and workers, allowing for a wide range of applications. Workers in the pool can be started, stopped, and have operations executed upon them, providing a robust framework for concurrent task execution.\n\n## Features\n\n- Generic implementation supporting any key and worker types.\n- Thread-safe operations to add, delete, and manipulate workers.\n- Error handling for start and stop operations of workers.\n\n## Installation\n\nTo install Luna, you need a working Go environment. Luna can be installed using `go get`:\n\n```sh\ngo get github.com/kaatinga/luna\n```\n\n## Usage\n\nHere's a simple example of how to use Luna:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/kaatinga/luna\"\n)\n\ntype myWorker struct{}\n\nfunc (myWorker) Start() error {\n\tfmt.Println(\"Worker started\")\n\treturn nil\n}\n\nfunc (myWorker) Stop() error {\n\tfmt.Println(\"Worker stopped\")\n\treturn nil\n}\n\nfunc main() {\n\tpool := luna.NewWorkerPool[string, myWorker]()\n\n\tif err := pool.Add(\"worker1\", myWorker{}); err != nil {\n\t\tfmt.Printf(\"Error adding worker: %v\\n\", err)\n\t}\n\n\tpool.Do(\"worker1\", func(item *luna.Item[string, myWorker]) {\n\t\tfmt.Println(\"Executing operation on worker\")\n\t})\n\n\tif err := pool.Delete(\"worker1\"); err != nil {\n\t\tfmt.Printf(\"Error removing worker: %v\\n\", err)\n\t}\n}\n```\n\n## Testing\n\nTo run the tests for Luna, navigate to the package directory and use the Go tool:\n\n```sh\ngo test ./...\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open issues to discuss potential improvements or features.\n\n## License\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaatinga%2Fluna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaatinga%2Fluna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaatinga%2Fluna/lists"}