javascript - php - background process of a jar file, how can i get asyncronously notified when process finishes? -


scenario: have php vagrant virtualbox server , runnable jar takes minutes run. ideally, when user goes route in application, server start running said jar in background user wont have wait looking @ blank page, and, when jar finishes executing, page automatically refresh(or data in it) giving user information got output of jar.

problem: far, managed run jar in background using exec() function. can process id , check if still running or not. problem have how can php(per say) notified when jar stops running without blocking normal execution? there way this? i've searched everywhere laravel queues forking running process nothing(as understood) suits needs.

edit: think may have found solution ask community anyway. use javascript loop (with setinterval) after page loads, , ,inside loop, make ajax async request server asking if process has ended, and, if so, bringing output of jar , updating web page new data. make "pull" solution instead of preferable "push" don't know push approach possible.

i'm still learning code web app , might silly question , apologize. please feel free put me in right path if solution off rails.

thanks in advance,

you should take @ js librairies made such purpose ex: nodejs.

it keeps pipe open between user , webserver , can send notice server specific user or group of user.

really love myself.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -