[nycphp-talk] PHP and running background tasks...
Jiju Thomas Mathew
lists at silmail.com
Mon Feb 26 08:13:58 EST 2007
>
> A good answer in this case is to write a cron job/scheduled task
> that wakes up every five minutes, sends a few mails, and then dies.
> The background job is controlled by a work queue, which could be a
> table in the database. A system like this can send e-mail messages,
> gather information, or do computations in an orderly way -- it's easy
> to put in job controls of various sorts.
>
Hey this is a great idea..
Last time when I had to do something like this; I will explain the
situation...
In one of our distributed applications, we have local installations at the
client branch offices, with local MySQL and front end application, which
communicates with a LAMP server, to update changes in the sql db, by
uploading a set of standard SQL queries. Here I wanted the server just to
verify the uploaded file, and tell the client that everything is okay if the
the md5 sum of the file passes.. and once this is over, this uploaded file
is placed into a folder, and a service listed with the xinetd, is initmated
using the fsock open.. and sending a predefined command. There the xinetd
service would just close the connection, and continue with processing the
uploaded file.. the queue method is somewhat as explained above, the only
difference is that I used the xinetd process to listen on a specified port
on the 127.x.x.x spectrum.
--
Jiju Thomas Mathew
http://www.php-trivandrum.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070226/a270c73f/attachment.html>
More information about the talk
mailing list