I am building API for processing with Lumen, the processing job is taking around 1-3 seconds per request.
So far i did it with job queue and beanstalkd and it is asynchronous, meaning i return job_id that i can check later for the result.
I am also writing PHP client to utilize the API and for that i am wondering if i should include 'wait' parameter server side or client side? If wait is implemented serverside i will need to sleep and check the database for results once the job is dispatched and then return result when available (in next 1-5 seconds until available), or if it is client side i will need to sleep and check with the job_id via specific route if the job finished and to get the results.
Which option is better option?