I have made some changes to the Drush integration to allow the queue to be run a little differently other than just calling the drupal_queue_cron_run() just once.

I have made it so you can run it 3 different ways.

1. As it is now, run once and exit, or n times.
2. Run forever.
3. Run until the all the queues have no jobs.

ATM I am using option 3 to process a ton of jobs that need to be caught up on.

Comments

gordon’s picture

StatusFileSize
new2.56 KB

I have fixed up the patch so that it will pass the tests and apply easier.

Status: Needs review » Needs work

The last submitted patch, 1020946.patch, failed testing.

Anonymous’s picture

subscribe.

sdboyer’s picture

Issue tags: +git phase 2, +git sprint 9

subscribe, and tagging as this may be crucial for phase 2

sdboyer’s picture

Issue tags: -git phase 2, -git sprint 9

Untagging. We got around it.

gordon’s picture

Status: Needs work » Needs review

drush.changes.patch queued for re-testing.

gordon’s picture

#1: 1020946.patch queued for re-testing.

neilnz’s picture

This is similar to what the DataSync (http://drupal.org/project/datasync) module does - it starts a daemon on cron that forks into multiple workers and they process the queue at a limited concurrency level until it's empty, then the forks exit back to the main daemon and it polls for jobs and the process starts again.

You might be able to take some inspiration from it?

I've been using DataSync in prod for years, just looking at switching to Drupal Queue, but it doesn't offer the same immediate-ish asynchronous execution of tasks that DataSync can.

gordon’s picture

Drupal Queue is a direct backport of the Drupal 7.x Queuing system. Also it's interface is pluggable so you can use queuing systems like beanstalkd to do the heavy lifting.

If you use something like job_queue (not sure of data sync) then changing to Drupal Queues is a must.

neilnz’s picture

Issue summary: View changes
StatusFileSize
new2.67 KB

I know this issue is ancient, but just adding a little bit to it that I've worked on.

I've redone the patch a little to output the debugging prints to STDERR instead of STDOUT and to allow the pause between executions to be configured in a variable (drush vset only, no UI). Also applied the loop pause when repeating a certain number of times, as running a tight loop with --repeat=60 thrashes the database quite hard unnecessarily.