{"id":18434896,"url":"https://github.com/bodo-hugo-barwich/process","last_synced_at":"2026-01-28T05:21:09.535Z","repository":{"id":44953267,"uuid":"144804655","full_name":"bodo-hugo-barwich/Process","owner":"bodo-hugo-barwich","description":"Perl Module for Multiprocessing","archived":false,"fork":false,"pushed_at":"2024-09-13T14:23:17.000Z","size":716,"stargazers_count":1,"open_issues_count":8,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-07T19:40:11.294Z","etag":null,"topics":["ipc","perl","perl-module","process-manager"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodo-hugo-barwich.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":"2018-08-15T04:09:59.000Z","updated_at":"2024-05-30T06:18:41.000Z","dependencies_parsed_at":"2024-09-14T03:13:42.579Z","dependency_job_id":null,"html_url":"https://github.com/bodo-hugo-barwich/Process","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/bodo-hugo-barwich/Process","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodo-hugo-barwich%2FProcess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodo-hugo-barwich%2FProcess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodo-hugo-barwich%2FProcess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodo-hugo-barwich%2FProcess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodo-hugo-barwich","download_url":"https://codeload.github.com/bodo-hugo-barwich/Process/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodo-hugo-barwich%2FProcess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28840088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T02:10:51.810Z","status":"ssl_error","status_checked_at":"2026-01-28T02:10:50.806Z","response_time":57,"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":["ipc","perl","perl-module","process-manager"],"created_at":"2024-11-06T06:06:18.613Z","updated_at":"2026-01-28T05:21:09.517Z","avatar_url":"https://github.com/bodo-hugo-barwich.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Automated Tests](https://github.com/bodo-hugo-barwich/Process/actions/workflows/automated_testing.yml/badge.svg)](https://github.com/bodo-hugo-barwich/Process/actions/workflows/automated_testing.yml)\n[![Publish new Release](https://github.com/bodo-hugo-barwich/Process/actions/workflows/publish_release.yml/badge.svg)](https://github.com/bodo-hugo-barwich/Process/actions/workflows/publish_release.yml)\n\n# Process\nProcess::SubProcess - Perl Module for Multiprocessing\n\nRunning Sub Processes in an easy way while reading STDOUT, STDERR, Exit Code and possible System Errors. \\\nIt also implements running multiple Sub Processes simultaneously while keeping all Report and Error Messages and Exit Codes\nseperate.\n\n# Features\nSome important Features are:\n* Asynchronous Launch\n* Reads Big Outputs\n* Execution Timeout\n* Configurable Read Interval\n* Captures possible System Errors at Launch Time like \"file not found\" Errors\n\n# Motivation\nThis Module was conceived out of the need to launch multiple Tasks simultaneously\nwhile still keeping each Log and Error Messages and Exit Codes separately.\\\nAs I developed it as Prototype at:\\\n[Multi Process Manager](https://stackoverflow.com/questions/50177534/why-do-pipes-from-child-processes-break-sometimes-and-sometimes-not)\\\nThe **Object Oriented Design** permits the implementation of the **[Command Pattern / Manager-Worker Pattern](https://en.wikipedia.org/wiki/Command_pattern)** with the `Process::SubProcess::Group` and `Process::SubProcess::Pool` Packages.\\\nHaving a similar implementation as the [`Capture::Tiny` Package](https://metacpan.org/pod/Capture::Tiny)\nit eventually evolved as a Procedural Replacement for the `Capture::Tiny::capture()` Function\nwhich is demonstrated under [Usage \u003e runSubProcess\\(\\) Function](#runsubprocess-function).\\\nThis capability also enabled its usage as Command Line Helper Tool with the `run_subprocess.pl` script\nas seen under [Usage \u003e Runner Script](#runner-script).\n\n## Example Use Case\nThe Usefulness of this Library is best shown by an Example Use Case as seen in the `Process::SubProcess::Group::Run` Test Sequence:\\\nHaving 3 Jobs at hand of 2 seconds, 3 seconds and 1 second running them sequencially would take aproximately **6 seconds**.\\\nBut using the `Process::SubProcess::Group` it takes effectively only **3 seconds** to complete.\\\nAnd still each Job can be evaluated separately by their own Results keeping Log Message separate from Error Messages and\nviewing them in their context.\n```\n# Subtest: Process::SubProcess::Group::Run\n    ok 1 - scripts (count: '3'): added correctly\nProcess Group Execution Start - Time Now: '1688542787.31262' s\n    ok 2 - Process Group Execution: Execution correct\nProcess Group Execution End - Time Now: '1688542790.33528' s\nProcess Group Execution finished in '3022.66407012939' ms\n    ok 3 - Process No. '0': Listed correctly\nProcess (8608) 'test-script:2s':\nERROR CODE: '0'\nEXIT CODE: '0'\nSTDOUT: 'Start - Time Now: '1688542787.33535' s\nscript 'test_script.pl' START 0\nscript 'test_script.pl' PAUSE '2' ...\nscript 'test_script.pl' END 1\nEnd - Time Now: '1688542789.33552' s\nscript 'test_script.pl' done in '2000.16403198242' ms\nscript 'test_script.pl' EXIT '0'\n'\nSTDERR: 'script 'test_script.pl' START 0 ERROR\nscript 'test_script.pl' END 1 ERROR\n'\n    ok 4 - Process No. '1': Listed correctly\nProcess (8609) 'test-script:3s':\nERROR CODE: '0'\nEXIT CODE: '0'\nSTDOUT: 'Start - Time Now: '1688542787.3336' s\nscript 'test_script.pl' START 0\nscript 'test_script.pl' PAUSE '3' ...\nscript 'test_script.pl' END 1\nEnd - Time Now: '1688542790.3338' s\nscript 'test_script.pl' done in '3000.19979476929' ms\nscript 'test_script.pl' EXIT '0'\n'\nSTDERR: 'script 'test_script.pl' START 0 ERROR\nscript 'test_script.pl' END 1 ERROR\n'\n    ok 5 - Process No. '2': Listed correctly\nProcess (8610) 'test-script:1s':\nERROR CODE: '0'\nEXIT CODE: '0'\nSTDOUT: 'Start - Time Now: '1688542787.34636' s\nscript 'test_script.pl' START 0\nscript 'test_script.pl' PAUSE '1' ...\nscript 'test_script.pl' END 1\nEnd - Time Now: '1688542788.34656' s\nscript 'test_script.pl' done in '1000.20098686218' ms\nscript 'test_script.pl' EXIT '0'\n'\nSTDERR: 'script 'test_script.pl' START 0 ERROR\nscript 'test_script.pl' END 1 ERROR\n'\n    1..5\nok 3 - Process::SubProcess::Group::Run\n```\n\n# Usage\n## Runner Script\nThe new **Runner Script** `run_subprocess.pl` lets process the output of different commandline tools\nin a organised manner and parse it correctly into _JSON_, _YAML_ or _Plain Text_ formats:\n```plain\n$ bin/run_subprocess.pl -n \"test-script fails\" -c \"t/test_script.pl 2 6\" -f json | jq '.'\n{\n  \"stdout\": \"Start - Time Now: '1688630328.73393' s\\nscript 'test_script.pl' START 0\\nscript 'test_script.pl' PAUSE '2' ...\\nscript 'test_script.pl' END 1\\nEnd - Time Now: '1688630330.73409' s\\nscript 'test_script.pl' done in '2000.15306472778' ms\\nscript 'test_script.pl' EXIT '6'\\n\",\n  \"name\": \"test-script fails\",\n  \"error_code\": 1,\n  \"stderr\": \"script 'test_script.pl' START 0 ERROR\\nscript 'test_script.pl' END 1 ERROR\\n\",\n  \"exit_code\": 6,\n  \"command\": \"t/test_script.pl 2 6\",\n  \"pid\": \"7273\"\n}\n```\n```plain\n$ bin/run_subprocess.pl -n \"test-script fails\" -c \"t/test_script.pl 2 6\" -f json | jq '.error_code,.exit_code'\n1\n6\n```\n```plain\n$ bin/run_subprocess.pl -n \"test-script fails\" -c \"t/test_script.pl 2 6\" -f json | jq '.stderr,.exit_code,.error_code'\n\"script 'test_script.pl' START 0 ERROR\\nscript 'test_script.pl' END 1 ERROR\\n\"\n6\n1\n```\n\n## runSubProcess() Function\nDemonstrating the `runSubProcess()` Function Use Case:\n```perl\nuse Process::SubProcess qw(runSubProcess);\n\nuse Test::More;\n\n\nmy $spath = '/path/to/test/script/';\nmy $stestscript = 'test_script.pl';\nmy $itestpause = 3;\nmy $iteststatus = 4;\n\nmy $rscriptlog = undef;\nmy $rscripterror = undef;\nmy $iscriptstatus = -1;\nmy $irunok = -1;\n\n\nsubtest 'runSubProcess() Function' =\u003e sub {\n\n  #Execute the Command\n  ($rscriptlog, $rscripterror, $iscriptstatus)\n    = runSubProcess(\"${spath}${stestscript} $itestpause $iteststatus\");\n\n  #Evaluate the Results\n\n  isnt($rscriptlog, undef, \"STDOUT Ref is returned\");\n  isnt($rscripterror, undef, \"STDERR Ref is returned\");\n  isnt($iscriptstatus, undef, \"EXIT CODE is returned\");\n  ok($iscriptstatus =~ qr/^-?\\d$/, \"EXIT CODE is numeric\");\n  is($iscriptstatus, $iteststatus, 'EXIT CODE is correct');\n\n  print(\"EXIT CODE: '$iscriptstatus'\\n\");\n\n  if(defined $rscriptlog)\n  {\n    isnt($$rscriptlog, '', \"STDOUT was captured\");\n\n    print(\"STDOUT: '$$rscriptlog'\\n\");\n  } #if(defined $rscriptlog)\n\n  if(defined $rscripterror)\n  {\n    isnt($$rscripterror, '', \"STDERR was captured\");\n\n    print(\"STDERR: '$$rscripterror'\\n\");\n  } #if(defined $rscripterror)\n};\n\ndone_testing();\n```\n\n# Documentation\nThe Class Diagramm kann be found at:\\\n[Class Diagram for the Package 'Process'](docs/Process.jpg)\\\n![Class Diagram for the Package 'Process'](docs/Process.jpg)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodo-hugo-barwich%2Fprocess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodo-hugo-barwich%2Fprocess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodo-hugo-barwich%2Fprocess/lists"}