2019-09-06 23:53:10 +08:00

15 lines
347 B
PHP
Executable File

<?php
$process = new swoole_process(function (swoole_process $worker)
{
echo "Worker: start. PID=" . $worker->pid . "\n";
sleep(2);
$worker->write("hello master\n");
$worker->exit(0);
}, false);
$pid = $process->start();
$r = array($process);
$ret = swoole_select($r, null, null, 1.0);
var_dump($ret);
var_dump($process->read());