channelService->channel->generateCommand} > /dev/null 2>&1 & echo $!",$op); $pid = (int)$op[0]; return redirect($this->channelService->channel->lucentUrl . "/build-report"); } public function report(): View { return $this->svelte->render( layout: "channel", view: "buildReport", title: "Build Report", ); } public function reportSource() { return response()->stream(function () { while (true) { $curDate = time(); echo 'data: {"time": "' . $curDate . '"}'; echo "\n\n"; logger( $curDate); ob_flush(); flush(); // Break the loop if the client aborted the connection (closed the page) if (connection_aborted()) {break;} sleep(2); // 50ms } }, 200, [ 'Cache-Control' => 'no-cache', 'X-Accel-Buffering' => 'no', 'Content-Type' => 'text/event-stream', ]); } }