Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

emmatraversy's avatar

Handle 10sec Time Consuming SSH Fetch From API

Hi guys I have a Inertia/React Project and have this Server page which shows all parts of a server (Disks, Controllers, FC Cards, Motherboards, ...) And I want to show Extra Information about each part after user clicks on each part.

So to obtain that I wanted to create an API endpoint in which I have to perform and ssh connection and run some scripts. The problem is normally ssh connection takes 2,3 sec, and performing the commands and getting result about 4 seconds roughly.

So I was wondering could i put it in a controller? Or should I create something like a Job? but how I listen for job outcome and what if user clicks away ... (If retrieving something like broadcasts and etc would it worth the complexity?)

many thanks in advance

0 likes
0 replies

Please or to participate in this conversation.