2010/1/21 Peter Rundle <[email protected]>:
> Cron jobs aren't the go, this is an event driven task that needs to happen
> when the event occurs, not some minutes/hours later when the cron jobs wakes
> up at the specified interval.

Cron is not the only way to process things in the background.

For instance - how about the request generates a file in a specified
directory, a daemon which keeps watching this directory (stat() on the
directory, or inotify) will notice the new file and act based on job
data contained in the file.

Just make sure to cover corner cases - e.g.
* create the file under some temporary name (e.g. .filename) until it
contains all the required information then rename it to the
name/directory under which the background process looks for it.
* Make sure to use a unique file name for each request.
* Monitor the background process with "monit".
* Monitor for accumulation of jobs in the "queue"

Cheers,

--Amos
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to