/** * Update data inside descriptor to make one more attempt * * @param RequestDescriptor $descriptor Operation descriptor * @param string $when When Timeout occurerd, one of TimeoutEvent::DURING_* consts * * @return void */ private function updateMetadataForAttempt(RequestDescriptor $descriptor, $when) { switch ($when) { case TimeoutEvent::DURING_IO: $descriptor->setMetadata(RequestExecutorInterface::META_LAST_IO_START_TIME, null); break; case TimeoutEvent::DURING_CONNECTION: $descriptor->setRunning(false); $descriptor->setMetadata([RequestExecutorInterface::META_LAST_IO_START_TIME => null, RequestExecutorInterface::META_CONNECTION_START_TIME => null, RequestExecutorInterface::META_CONNECTION_FINISH_TIME => null]); break; } }