private function accept($watcherId, $ipcServer)
{
if (!($ipcClient = @stream_socket_accept($ipcServer, $timeout = 0))) {
return;
}
if ($this->stopPromisor) {
@\fwrite($ipcClient, "\n");
}
stream_set_blocking($ipcClient, false);
$parser = $this->parser($ipcClient);
$readWatcherId = \Amp\onReadable($ipcClient, function () use($parser) {
$parser->next();
});
$this->ipcClients[$readWatcherId] = $ipcClient;
$parser->send($readWatcherId);
assert(!empty($this->spawnPromisors));
array_shift($this->spawnPromisors)->succeed();
}