public function __construct(Worker $worker, EventDispatcher $event, $socket, Pipeline $pipeline, Config $config = null, WriteBuffer $writeBuffer = null) { $this->worker = $worker; $this->event = $event; $this->socket = $socket; $this->pipeline = $pipeline; $this->config = $config ?? $this->createConfig(); $this->timestamp = $worker->getTimestamp(); $this->timestamp->mark(ServerTimestampType::ClientStart); $this->eventAcceptor = $this->createEventAcceptor(); $this->eventAcceptor->setEvent($this->event); $this->eventAcceptor->register(); $this->pipeline->bind('client', $this); $this->pipeline->open(); $this->writeBuffer = $writeBuffer ?? $this->createWriteBuffer(); }
public function kill(Worker $worker) { posix_kill($worker->getPid(), SIGKILL); $this->workers->detach($worker); }