CodeIgniter Forums
Use thread for send sms - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Use thread for send sms (/showthread.php?tid=71246)

Pages: 1 2


RE: Use thread for send sms - omid_student - 07-28-2018

(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