swoole进程小例子

write($countent.PHP_EOL);
        echo $countent.PHP_EOL;
    },true);
    $pid = $process->start();
    $works[$pid] = $process;
}

foreach ($works as $process){
    echo $process->read();
}

function curlData($url){
    //curl file_get_contents
    sleep(1);
    return $url ."成功".PHP_EOL;
}
echo "结束时间".date("Y-m-d H:i:s").PHP_EOL;
swoole进程小例子_第1张图片
一秒处理这些逻辑

你可能感兴趣的:(swoole进程小例子)