Endless loop applications are commonly called daemons. These are system services that offer some ongoing processing and / or willingness to accept some potential inbound processing.
Gearman is a system daemon that you can install, which can handle the various tasks that you give them. These are sophisticated tools that allow a lot, but can be used to fulfill your needs.
PHP :: Gearman is a Gearman client that talks to the Gearman daemon and sends tasks to the daemon, determining the conditions under which the task should be performed.
The limitations that @Jeffrey emphasized regarding PHP are true because PHP was designed as nothing architecture (loading one page equals one execution of the script - each page loading works within its own data context).
Perhaps System Daemon (the pear pack) can help overcome some or all of the limitations mentioned above. I have not used it, so I canβt tell you more about this, but itβs a good place to start, like everyone else.
source share