Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | advancedqueue-delayed_processing-2505881-3.patch | 2.28 KB | maciej.zgadzaj |
Comments
Comment #1
jweirather CreditAttribution: jweirather commented+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.
Comment #2
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedThat'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.)Comment #3
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedNew patch version with an example added to
advancedqueue_example_advanced_queue_info()
.Comment #4
Kazanir CreditAttribution: Kazanir at Platform.sh commentedWe'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.
Comment #6
Kazanir CreditAttribution: Kazanir at Platform.sh commentedComment #7
amonteroThank you very much, Kazanir. Much appreciated.
Adding link to alternative solution to the OP for completion.