Welcome Guest, Not a member yet? Register   Sign In
Use thread for send sms
#11

(07-23-2018, 05:50 AM)qury Wrote: I have something similar in my application where i run SQL request and generate an xlsx file out of the result.

For me it works like this:

1, UI sends the query id or the sql via ajax to a back-end function
2 I have a worker daemon that receives the sql string and executes it and creates the xlsx file
3 The back-end uses zmq library to pass on the details and the sql string to the worker

The advantage for me is that i do not have to wait for the back-end tasks to complete to allow the user to navigate away from the page. It is a fire and forget solution.

If you have to provide a status for your sms, you could do get the worker in this case to update the DB with a success or failure status.

Also you could have a "fan" and multiple workers that could send the sms in parallel.

See this http://zguide.zeromq.org/php:all

Thank you
Reply




Theme © iAndrew 2016 - Forum software by © MyBB