/** {@inheritdoc} */ public function onEvent(RequestDescriptor $requestDescriptor, $type) { $doResetEvent = false; switch ($type) { case LeCallbackInterface::EVENT_READ: // fall down // fall down case LeCallbackInterface::EVENT_WRITE: $result = $this->ioStage->processStage([$requestDescriptor]); $doResetEvent = empty($result); break; case LeCallbackInterface::EVENT_TIMEOUT: $doResetEvent = $this->timeoutStage->handleTimeoutOnDescriptor($requestDescriptor); break; } if ($doResetEvent) { $meta = $requestDescriptor->getMetadata(); $this->setupEvent($requestDescriptor, $meta[self::META_IO_TIMEOUT]); } else { $this->disconnectStage->processStage([$requestDescriptor]); } $this->connectSockets(); }
/** * Disconnect given list of sockets * * @param RequestDescriptor[] $items Sockets' operations * * @return void */ public function disconnectSockets(array $items) { $this->disconnectStage->processStage($items); }