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

(07-23-2018, 12:41 AM)Pertti Wrote: Depends how quick you want your texts to be delivered.

You could build AJAX solution, so the 2 second delay is masked.

If you are OK with texts taking a bit longer to deliver, you could set up a cron job to run every minute, keep queue of pending texts in DB, so response on website is instant, but it'll take up to a minute to fire off texts.

Your third, and most complicated option is to build persistent PHP script that keeps running and checking DB in shorter intervals (cron can only do every minute as shortest time-unit). That's the solution we use here, but it's a bit tricky, PHP sometimes can run out of memory, so I had to build in feature where we have monitoring cron job that checks scripts process is there every minute, and a shut-down point in script so if it's using too much memory, it'll close down and another process can be created by cron monitor script.

Cron Job execute every a minute at least and sms must be deliver in 2 minute so cron job is bad idea
Is it good curl_init for run special page for send sms?
Reply


Messages In This Thread
Use thread for send sms - by omid_student - 07-23-2018, 12:30 AM
RE: Use thread for send sms - by Pertti - 07-23-2018, 12:41 AM
RE: Use thread for send sms - by omid_student - 07-23-2018, 01:03 AM
RE: Use thread for send sms - by Pertti - 07-23-2018, 01:19 AM
RE: Use thread for send sms - by omid_student - 07-23-2018, 01:38 AM
RE: Use thread for send sms - by Pertti - 07-23-2018, 01:55 AM
RE: Use thread for send sms - by omid_student - 07-23-2018, 02:19 AM
RE: Use thread for send sms - by Pertti - 07-23-2018, 03:02 AM
RE: Use thread for send sms - by omid_student - 07-23-2018, 03:44 AM
RE: Use thread for send sms - by qury - 07-23-2018, 05:50 AM
RE: Use thread for send sms - by omid_student - 07-28-2018, 06:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB