運(yùn)行優(yōu)先級如下:
疑問:這樣的執(zhí)行順序,為了status 命令去查看是否有業(yè)務(wù)阻塞?
if (!$this->scheduler->isEmpty()) {
$this->tick();
}
foreach ($read as $fd) {
$fdKey = (int)$fd;
if (isset($this->readEvents[$fdKey])) {
$this->readEvents[$fdKey]($fd);
}
}
foreach ($write as $fd) {
$fdKey = (int)$fd;
if (isset($this->writeEvents[$fdKey])) {
$this->writeEvents[$fdKey]($fd);
}
}
foreach ($except as $fd) {
$fdKey = (int)$fd;
if (isset($this->exceptEvents[$fdKey])) {
$this->exceptEvents[$fdKey]($fd);
}
}
if (!empty($this->signalEvents)) {
// Calls signal handlers for pending signals
pcntl_signal_dispatch();
}