Requested feature:
Allow a queue to not dequeue items when claiming until a configurable time since their creation has passed. Thus, you can get a sort of 'delayed processing' queue.

Adding a 'delay' or similar property to the _info hook and adjusting the ':created' query parameter would do the trick.

Does the feature sounds interesting enough to maintainers to accept such a patch?

EDIT: Since this feature was not added until Jan '17, I created the Delayed Queue module in the meanwhile to solve this issue using Drupal Core's standard queue backend. Adding here for completion.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jweirather’s picture

+1

I don't have a pressing need ATM, but scheduling queue items is always a handy tool to have.

Would love to see this. Coding it is a bit over my head right now.

maciej.zgadzaj’s picture

Status: Active » Needs review
FileSize
1.61 KB

That's really simple change, but a nice feature.

Patch adding the start delay property to queue definition array attached.

(It also fixes advancedqueue_get_queues_info()'s $queue_names parameter handling, as until now the queue names to return the info for needed to be provided in parameter's array keys instead of values.)

maciej.zgadzaj’s picture

New patch version with an example added to advancedqueue_example_advanced_queue_info().

Kazanir’s picture

We've been using this at Platform.sh for a while, but in a different form. We simply allow the item's data package to specify the "created" timestamp at creation time (it is moved from the "data" array out to the item itself on creation) so that individual items can be timed to run later. In this way it does not depend on the queue info (and you aren't locked into it on a per-queue basis.) Commit will be forthcoming.

  • Kazanir committed be099ed on 7.x-1.x
    Issue #2505881 by maciej.zgadzaj, Kazanir: Allow item creation to post-...
Kazanir’s picture

Status: Needs review » Fixed
amontero’s picture

Issue summary: View changes

Thank you very much, Kazanir. Much appreciated.
Adding link to alternative solution to the OP for completion.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.