{"id":15473963,"url":"https://github.com/adwpc/pagent","last_synced_at":"2026-03-09T23:03:29.279Z","repository":{"id":55508783,"uuid":"139550808","full_name":"adwpc/pagent","owner":"adwpc","description":"child process agent by golang","archived":false,"fork":false,"pushed_at":"2020-12-25T09:47:38.000Z","size":6,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T14:05:46.544Z","etag":null,"topics":["agent","child","golang","process"],"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/adwpc.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-07-03T08:16:18.000Z","updated_at":"2022-02-17T15:57:15.000Z","dependencies_parsed_at":"2022-08-15T02:01:06.870Z","dependency_job_id":null,"html_url":"https://github.com/adwpc/pagent","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/adwpc/pagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fpagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fpagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fpagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fpagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adwpc","download_url":"https://codeload.github.com/adwpc/pagent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fpagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30315987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"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":["agent","child","golang","process"],"created_at":"2024-10-02T03:00:54.970Z","updated_at":"2026-03-09T23:03:29.260Z","avatar_url":"https://github.com/adwpc.png","language":"Go","readme":"## pagent\n[![Build Status](https://travis-ci.org/adwpc/pagent.svg?branch=master)](https://travis-ci.org/adwpc/pagent)\n\npagent is a child process agent, with a focus on being:\n\n* simple: child and parent process communicate with stdin and stdout\n* secure: Multi-Process is safe than Multi-Thread/Multi-Goroutine\n* decoupling your biz code with callback func\n\n## demo\n\n```\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    \"github.com/adwpc/pagent\"\n)\n\ntype MyBiz struct {\n    pagent.Master\n}\n\nfunc NewBiz() *MyBiz {\n    return \u0026MyBiz{}\n}\n\nfunc (a *MyBiz) BizRunning(id, str string) error {\n    fmt.Println(\"[MyBiz BizRunning] str=\" + str)\n    return nil\n}\n\nfunc (a *MyBiz) BizFinish(id string, err error) error {\n    fmt.Println(\"[MyBiz BizFinish] id=\" + id)\n    return err\n}\n\nfunc main() {\n    a := NewBiz()\n\n    fmt.Println(\"worker1-------------------------\")\n    a.GetWorker(\"worker1\").Start(\"bash\", a.BizRunning, a.BizFinish)\n    a.GetWorker(\"worker1\").Input(\"ls\")\n    time.Sleep(1 * time.Second)\n    a.DelWorker(\"worker1\")\n\n    fmt.Println(\"worker2-------------------------\")\n    a.GetWorker(\"worker2\").Start(\"ifconfig\", nil, a.BizFinish)\n    time.Sleep(1 * time.Second)\n    a.DelWorker(\"worker2\")\n\n    fmt.Printf(\"end!----------------------------\")\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwpc%2Fpagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadwpc%2Fpagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwpc%2Fpagent/lists"}