medeirosinacio / exec-multithread
使用 exec 函数实现的 PHP 线程实现。
dev-master
2020-04-16 18:54 UTC
Requires
- php: >=7.4
- ext-json: *
- ext-posix: *
This package is auto-updated.
Last update: 2024-09-17 04:24:20 UTC
README
php-exec-multithread
使用 exec 函数实现的 PHP 线程实现。
将作业与数据发送到工作进程
$thread = new ExecMultithread();
$thread->setProjectRoot('./');
for ($i = 0; $i < 5; $i++) {
$data = "Bla Bla Bla... ID " . md5(rand(0, 5000));
$thread->startProcess('worker', $data);
}
$thread->getProcessesInfo();
获取工作进程数据
$data = ExecMultithread::convertData($argv[1])