PHP Classes

Simpler way to run Daemon

Recommend this page to a friend!

      PHP Classes blog  >  Creating a PHP Daemon...  >  All threads  >  Simpler way to run Daemon  >  (Un) Subscribe thread alerts  
Subject:Simpler way to run Daemon
Summary:Use the open source DaemonTools Supervise
Messages:1
Author:Jim Katz
Date:2015-03-27 15:19:08
Update:2015-03-27 17:09:40
 

  1. Simpler way to run Daemon   Reply   Report abuse  
Picture of Jim Katz Jim Katz - 2015-03-27 17:09:40
My client runs two processes as services that I wrote in PHP. One manages our email alert system(sends email alerts when certain vehicle conditions are met) and the other collects data at 30 second intervals from another AVL(automatic vehicle location) service though their web service. I use a loop statement with an enclosed wait statement to set the interval. The DaemonTools install can be found here: http://cr.yp.to/daemontools.html (Not to be confused with the Windows based imaging tools package).

EG:

while (true){
//Do important Stuff!
wait(30);
}