<br><br><div><span class="gmail_quote">On 3/12/07, <b class="gmail_sendername">Neil Drumm</b> <<a href="mailto:drumm@delocalizedham.com">drumm@delocalizedham.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I sometimes find myself building a queue in a hook_cron()<br>implementation. I decided to make a separate module for this,<br>job_queue, <a href="http://drupal.org/project/job_queue">http://drupal.org/project/job_queue</a>
. It provides an API<br>which takes a function name and array of arguments for later execution<br>on cron. The only UI is a list of queued function calls.</blockquote><div><br>We implemented something similar to this for the CivicSpace ASP. In general, when people are looking for queues they tend to use other programming languages like Python that provide daemons as part of the core language. PHP's daemon capabilities are lacking so a queue supplements this missing piece with a cron job working through the queue.
<br><br>This is particular important when you want to put a lot of load but it can be spread out. For example, changing the schema of a thousand sites or re-indexing search tables for all sites in a multi-site configuration.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is this functionality something that people would like to see in core?<br>Search module has a 'queue' of unindexed content, would it benefit
<br>from having an abstracted queue?</blockquote><div><br>I'd recommend the following features.<br><br>1) Error states for the queue. If a job fails it will set an error level. This is particularly useful for queue logging.
<br>2) A way to tell if queue jobs are still running. This would need to be set for each server instance empirically. If your queued job takes longer than the cron cycle, then you can get escalation issues. You'll want to know wether your server can process 1, 2, 3, or 10 jobs in the queue simultaneously.
<br>3) A global counter for multi-site configurations. If there is a queue, you probably want it to be aware of the resources being expended on other Drupal sites on the same server.<br><br>Cheers,<br>Kieran<br></div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">--<br>Neil Drumm<br><a href="http://delocalizedham.com">http://delocalizedham.com</a><br></blockquote>
</div><br><br clear="all"><br>-- <br>To strive, to seek, to find, and not to yield.<br>