{"id":13413070,"url":"https://github.com/hmdsefi/gowl","last_synced_at":"2026-01-14T21:35:09.083Z","repository":{"id":37252655,"uuid":"357311822","full_name":"hmdsefi/gowl","owner":"hmdsefi","description":"Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.","archived":false,"fork":false,"pushed_at":"2023-10-19T07:56:42.000Z","size":342,"stargazers_count":71,"open_issues_count":5,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-01T02:56:32.300Z","etag":null,"topics":["concurrency","concurrent-programming","go","golang","monitor","monitoring","monitoring-tool","pool","pooling","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/hmdsefi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-12T19:15:53.000Z","updated_at":"2025-08-12T15:56:14.000Z","dependencies_parsed_at":"2024-04-09T09:01:00.197Z","dependency_job_id":null,"html_url":"https://github.com/hmdsefi/gowl","commit_stats":null,"previous_names":["hamed-yousefi/gowl"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hmdsefi/gowl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmdsefi%2Fgowl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmdsefi%2Fgowl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmdsefi%2Fgowl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmdsefi%2Fgowl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmdsefi","download_url":"https://codeload.github.com/hmdsefi/gowl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmdsefi%2Fgowl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27644341,"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","status":"online","status_checked_at":"2025-12-10T02:00:12.818Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["concurrency","concurrent-programming","go","golang","monitor","monitoring","monitoring-tool","pool","pooling","worker-pool"],"created_at":"2024-07-30T20:01:33.101Z","updated_at":"2026-01-14T21:35:09.067Z","avatar_url":"https://github.com/hmdsefi.png","language":"Go","funding_links":[],"categories":["Goroutines"],"sub_categories":["Search and Analytic Databases","Advanced Console UIs"],"readme":"# Gowl\n\n![build](https://github.com/hmdsefi/gowl/actions/workflows/build.yml/badge.svg)\n[![codecov](https://codecov.io/gh/hmdsefi/gowl/branch/master/graph/badge.svg?token=1TYYX8IBR0)](https://codecov.io/gh/hmdsefi/gowl)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hamed-yousefi/gowl)](https://goreportcard.com/report/github.com/hamed-yousefi/gowl)\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B24403%2Fgithub.com%2Fhamed-yousefi%2Fgowl.svg?type=shield)](https://app.fossa.com/projects/custom%2B24403%2Fgithub.com%2Fhamed-yousefi%2Fgowl?ref=badge_shield)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) \n[![Go Reference](https://pkg.go.dev/badge/github.com/hamed-yousefi/gowl.svg)](https://pkg.go.dev/github.com/hamed-yousefi/gowl)\n\u003cdiv  align=\"center\"\u003e\u003cimg src=\"https://github.com/hamed-yousefi/gowl/blob/master/docs/images/process-pool.png\" width=\"450\" \u003e\u003c/div\u003e\nGowl is a process management and process monitoring tool at once.\nAn infinite worker pool gives you the ability to control the pool and processes\nand monitor their status.\n\n## Table of Contents\n\n* [Install](#Install)\n* [How to use](#How-to-use)\n    * [Pool](#Pooling)\n      * [Start](#Start)\n      * [Register process](#Register-process)\n      * [Kill process](#Kill-process)\n      * [Close](#Close)\n    * [Monitor](#Monitor)\n* [License](#License)\n\n## Install\n\nUsing Gowl is easy. First, use `go get` to install the latest version of the library. This command will install\nthe `gowl` along with library and its dependencies:\n\n```shell\ngo get -u github.com/hamed-yousefi/gowl\n```\n\nNext, include Gowl in your application:\n\n```go\nimport \"github.com/hamed-yousefi/gowl\"\n```\n\n## How to use\n\nGowl has three main parts. Process, Pool, and Monitor. The process is the smallest part of this project. The process is\nthe part of code that the developer must implement. To do that, Gowl provides an interface to inject outside code into\nthe pool. The process interface is as follows:\n\n```go\nProcess interface {\nStart(ctx context.Context) error\nName() string\nPID() PID\n}\n```\n\nThe process interface has three methods. The Start function contains the user codes, and the pool workers use this\nfunction to run the process. The Name function returns the process name, and the monitor uses this function to provide\nreports. The PID function returns process id. The process id is unique in the entire pool, and it will use by the pool\nand monitor.\n\nIf properly done it should respond to the context cancellation (if needed)\n\nLet's take a look at an example:\n\n```go\nDocument struct {\n   content string\n   hash string\n}\n\nfunc (d *Document) Start(ctx context.Context) error {\n   hasher := sha1.New()\n   hasher.Write(bv)\n   h.hash = base64.URLEncoding.EncodeToString(hasher.Sum(nil))\n}\n\nfunc (d *Document) Name() string {\n   return \"hashing-process\"\n}\n\nfunc (d *Document) PID() PID {\n   return \"p-1\"\n}\n\nfunc (d *Document) Hash() string {\n   return h.hash\n}\n```\n\nAs you can see, in this example, `Document` implements the Process interface. So now we can register it into the pool.\n\n### Pool\n\nCreating Gowl pool is very easy. You must use the `NewPool(size int)`\nfunction and pass the pool size to this function. Pool size indicates the worker numbers in and the underlying queue\nsize that workers consume process from it. Look at the following example:\n\n```go\npool := gowl.NewPool(4)\n```\n\nIn this example, Gowl will create a new instance of a Pool object with four workers and an underlying queue with the\nsize of four.\n\n#### Start\n\nTo start the Gowl, you must call the `Start()` method of the pool object. It will begin to create the workers, and\nworkers start listening to the queue to consume process.\n\n#### Register process\n\nTo register processes to the pool, you must use the `Register(args ...process)`\nmethod. Pass the processes to the register method, and it will create a new publisher to publish the process list to the\nqueue. You can call multiple times when Gowl pool is running.\n\n#### Kill process\n\nOne of the most remarkable features of Gowl is the ability to control the process after registered it into the pool. You\ncan kill a process before any worker runs it, this also works after the job have started if it consideres the context\ncancellation. Killing a process is simple, and you need the process id to do it.\n\n```go\npool.Kill(PID(\"p-909\"))\n```\n\n#### Close\n\nGowl is an infinite worker pool. However, you should have control over the pool and decide when you want to start it,\nregister a new process on it, kill a process, and `close` the pool and terminate the workers. Gowl gives you this option\nto close the pool by the `Close()` method of the Pool object.\n\n## Monitor\n\nEvery process management tool needs a monitoring system to expose the internal stats to the outside world. Gowl gives\nyou a monitoring API to see processes and workers stats.\n\nYou can get the Monitor instance by calling the `Monitor()` method of the Pool. The monitor object is as follows:\n\n```go\nMonitor interface {\n   PoolStatus() pool.Status\n   Error(PID) error\n   WorkerList() []WorkerName\n   WorkerStatus(name WorkerName) worker.Status\n   ProcessStats(pid PID) ProcessStats\n}\n```\n\nThe Monitor gives you this opportunity to get the Pool status, process error, worker list, worker status, and process\nstats. Wis Monitor API, you can create your monitoring app with ease. The following example is using Monitor API to\npresent the stats in the console in real-time.\n\n![process-monitoring](https://github.com/hamed-yousefi/gowl/blob/master/docs/images/process-monitoring.gif)\n\nAlso, you can use the Monitor API to show worker status in the console:\n\n![worker-monitoring](https://github.com/hamed-yousefi/gowl/blob/master/docs/images/worker-monitoring.gif)\n\n## License\n\nMIT License, please see [LICENSE](https://github.com/hamed-yousefi/gowl/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmdsefi%2Fgowl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmdsefi%2Fgowl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmdsefi%2Fgowl/lists"}