{"id":36798152,"url":"https://github.com/yolossn/process-manager","last_synced_at":"2026-01-12T13:31:48.810Z","repository":{"id":57544137,"uuid":"296223982","full_name":"yolossn/process-manager","owner":"yolossn","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-17T18:04:28.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-16T03:31:58.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/yolossn.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":"2020-09-17T05:01:48.000Z","updated_at":"2023-03-04T11:33:40.000Z","dependencies_parsed_at":"2022-09-16T23:01:41.785Z","dependency_job_id":null,"html_url":"https://github.com/yolossn/process-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yolossn/process-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolossn%2Fprocess-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolossn%2Fprocess-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolossn%2Fprocess-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolossn%2Fprocess-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yolossn","download_url":"https://codeload.github.com/yolossn/process-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolossn%2Fprocess-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339157,"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":[],"created_at":"2026-01-12T13:31:48.311Z","updated_at":"2026-01-12T13:31:48.546Z","avatar_url":"https://github.com/yolossn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n  \u003ch1 align=\"center\"\u003eProcess Manager\u003c/h1\u003e\n  \n  \u003cimg src=\"https://github.com/yolossn/process-manager/workflows/build/badge.svg?branch=master\"/\u003e\n\n  \u003ca href=\"https://goreportcard.com/report/github.com/yolossn/process-manager\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/yolossn/process-manager\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Design Decision\n\n1. Manager provides the process with command, backoff strategy and maxRetries. The process takes care of retries internally.\n   Why ?\n   In this case the manager doesnt dynamically change the retry strategy or retry count based on the process outcome so the sole responsibility of completing the command with retries belongs to the process.\n2. Both processes which have reached maxRetries and the ones which have run succesfully are considered complete.\n3. If an Interupt or Kill is made when the processes are executing the manager kills the processes which have not completed yet and exits.\n\n## Improvements\n\n1. Improve tests (Add table tests, increase coverage)\n2. Make backoff strategy configurable. Now it is a constant backoff of 1 second\n\n## Example\n\n### Config\n\n```yaml\ncommands:\n  - command: bash\n    args:\n      - -c\n      - echo $PWD\n    envs:\n      - key: PWD\n        value: /Users/santhoshnagarajs/git/\n    maxRetries: 2\n  - command: ld\n    args:\n      - $PWD\n    envs:\n      - key: PWD\n        value: /Users/santhoshnagarajs/git/yolossn/proccess-manager\n    maxRetries: 100\n```\n\n### Usage\n\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/yolossn/process-manager/pkg/config\"\n\t\"github.com/yolossn/process-manager/pkg/manager\"\n)\n\nfunc main() {\n\n\tconf, err := config.FromYaml(\"./config.yaml\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tman := manager.New(conf.Commands)\n\n\tnow := time.Now()\n\n\tdone := man.Run()\n\n\ttime.Sleep(time.Second * 3)\n\n\tman.Stop()\n\t\u003c-done\n\n\tfmt.Println(\"Successful process count: \", man.SuccessCount())\n\tfmt.Println(\"Failed process count: \", man.FailCount())\n\n\t// Done\n\tfmt.Println(\"done\", time.Since(now))\n}\n\n```\n\n## Test\n\n\u003e go test pkg/\\* -v -cover -race\n\n```\n=== RUN   TestNewStaticBackoff\n--- PASS: TestNewStaticBackoff (0.00s)\nPASS\ncoverage: 100.0% of statements\nok      github.com/yolossn/process-manager/pkg/backoff  1.619s  coverage: 100.0% of statements\n=== RUN   TestFromFile\n=== PAUSE TestFromFile\n=== CONT  TestFromFile\n--- PASS: TestFromFile (0.00s)\nPASS\ncoverage: 91.7% of statements\nok      github.com/yolossn/process-manager/pkg/config   1.410s  coverage: 91.7% of statements\n=== RUN   TestNewManager\n=== PAUSE TestNewManager\n=== RUN   TestRun\n=== PAUSE TestRun\n=== CONT  TestRun\n=== CONT  TestNewManager\n--- PASS: TestNewManager (0.00s)\n--- PASS: TestRun (6.08s)\n    manager_test.go:31: 1\n    manager_test.go:32: 3\nPASS\ncoverage: 89.4% of statements\nok      github.com/yolossn/process-manager/pkg/manager  7.992s  coverage: 89.4% of statements\n=== RUN   TestNew\n=== PAUSE TestNew\n=== RUN   TestRun\n=== PAUSE TestRun\n=== CONT  TestRun\n=== CONT  TestNew\n--- PASS: TestNew (0.00s)\n--- PASS: TestRun (5.12s)\nPASS\ncoverage: 96.4% of statements\nok      github.com/yolossn/process-manager/pkg/process  7.326s  coverage: 96.4% of statements\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyolossn%2Fprocess-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyolossn%2Fprocess-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyolossn%2Fprocess-manager/lists"}