ProcessExecutionTime::NOW]; // remote might only need a confirmation that this is a valid loopback endpoint if ($token === '__ping__') { return new DataResponse(['ping' => $this->appConfig->getValueString('core', CoreConfigLexicon::ASYNC_LOOPBACK_PING)]); } $this->async($token); try { $this->forkManager->runSession($token, $metadata); } catch (BlockAlreadyRunningException) { // TODO: debug() ? } exit(); } private function async(string $result = ''): void { if (ob_get_contents() !== false) { ob_end_clean(); } header('Connection: close'); header('Content-Encoding: none'); ignore_user_abort(); $timeLimit = 100; set_time_limit(max($timeLimit, 0)); ob_start(); echo($result); $size = ob_get_length(); header('Content-Length: ' . $size); ob_end_flush(); flush(); } }