{"id":42808734,"url":"https://github.com/white-poto/react-multi-process","last_synced_at":"2026-01-30T04:33:47.910Z","repository":{"id":56997960,"uuid":"46105425","full_name":"white-poto/react-multi-process","owner":"white-poto","description":"multi process support to reactphp","archived":false,"fork":false,"pushed_at":"2016-07-01T03:55:18.000Z","size":30,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T02:49:00.221Z","etag":null,"topics":["multi-process","reactphp","sync"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/white-poto.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":"2015-11-13T06:56:53.000Z","updated_at":"2024-10-02T10:08:40.000Z","dependencies_parsed_at":"2022-08-21T11:10:19.147Z","dependency_job_id":null,"html_url":"https://github.com/white-poto/react-multi-process","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/white-poto/react-multi-process","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/white-poto%2Freact-multi-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/white-poto%2Freact-multi-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/white-poto%2Freact-multi-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/white-poto%2Freact-multi-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/white-poto","download_url":"https://codeload.github.com/white-poto/react-multi-process/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/white-poto%2Freact-multi-process/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28902008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"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":["multi-process","reactphp","sync"],"created_at":"2026-01-30T04:33:44.323Z","updated_at":"2026-01-30T04:33:47.905Z","avatar_url":"https://github.com/white-poto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"react-multi-process\n=========================\nmulti process support to reactphp\n\nWhy use react-multi-process\n-----------------------------\nWhen we use `react/event-loop` to write async programs, we can not be sure \nthat every module is a no-blocking module(sync mysql client...).  \nSo we use multi process to improve the performance of our sync program.\n\nImport\n-----------------------------\n```shell\ncomposer require jenner/react-multi-process\n```\n\nHow to use it?\n----------------------------------\nSo simple like:\n```php\n$loop = React\\EventLoop\\Factory::create();\n$server = stream_socket_server('tcp://127.0.0.1:4020');\nstream_set_blocking($server, 0);\n$loop-\u003eaddReadStream($server, function ($server) use ($loop) {\n    $conn = stream_socket_accept($server);\n    $data = \"pid:\" . getmypid() . PHP_EOL;\n    $loop-\u003eaddWriteStream($conn, function ($conn) use (\u0026$data, $loop) {\n        $written = fwrite($conn, $data);\n        if ($written === strlen($data)) {\n            fclose($conn);\n            $loop-\u003eremoveStream($conn);\n        } else {\n            $data = substr($data, 0, $written);\n        }\n    });\n});\n\n// the second param is the sub process count\n$master = new \\React\\Multi\\Master($loop, 20);\n$master-\u003estart();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhite-poto%2Freact-multi-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhite-poto%2Freact-multi-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhite-poto%2Freact-multi-process/lists"}