I am wondering how to design a certain transaction process i want to build into my website and am looking for any guidance people have.
I have a website which accepts rental enquiries onto a table. I've been emailing out the enquiries to around 60 email addresses as they are submitted into an html form on the site and also updating the mysql table. As the number of emails i have to send grows i realise i want to create a cron job to send the mails now. As the enquiries are added to the mysql table i want to set a status column to A for "awaiting posting". I then want the cron job to pick up all status A enquiries and send out emails whilst setting the status on the table to P for "posted." Query i have is how do i cater for the fact that enquiries may be coming in as i am reading the table making this prone to issues. What is the best way to handle this scenario?
you can either use your own crown system for your server. Or use the good old fork to spawn an extra thread to work on those emails while. Or use the Gearman system/library which main role is to help do parallelism easier in PHP