I recently proposed a new module, Queue Manager (http://drupal.org/sandbox/tsphethean/1678466) and requested it be approved for full module status (http://drupal.org/node/1910630). The view was that the functionality from my sandbox could be merged with this module to allow management of individual queue items.

Queue Manager propsed the following (only for Database Queues):

  • View all Database Queues in your Drupal database
  • View the details of individual queue items in a queue
  • Force the releasing of individual queue items in a queue
  • Force the deletion of individual queue item in a queue

Thinking about this from a Queue UI perspective, I think we could do the following:

  • Enhance hook_queue_info() to include the 'queue class' - Queue UI can then be used to set the queue_class_{queue_name} variable which defines the queue backend to be used for processing this queue. This would prevent queue implementers having to either set their own variable, or edit $conf.
  • The Queue UI page could then be group by queue class, possibly as separate fieldsets, all defaulting to collapsed, to allow the user to quickly get to the queue types. This would also mean we could provide different functionality for different queue backends (i.e. for DB queues we can offer a lot more because we have direct access to the database to manually run SQL, whilst other queue backends will be limited in what they can do - maybe eventually we could provide hooks into this so that when new Queue backends are implemented they can build in the functionality appropriate for that backend)
  • For database queues, I think the majority of UX/UI from my sandbox could work (although very open to other ideas), my main aim was to make it quite similar to the dblog reports screen in terms of how information was laid out, with the addition of executing delete/release on a per item basis (should probably make this multi-item capable too).
  • I'm in two minds about how far we go with trying to display queue item data directly on non-DB queues created in other backeds, mainly because the queue software will provide some kind of interface itself (ie ActiveMQ provides the same functionality I'm proposing within Drupal for DB queues) but also because the only way I can see to do this would be via the Queue API claiming items with a lease time of zero to get the item data. That would not only be very expensive, as Queue API has no concept of retrieving specific items, but could also interfere with how the downstream queue providers behave based on claiming of items etc - hence my preference for the hook type idea above.

I've noticed a few issues in the issue queue discussing the pros and cons of hook queue info, so in thinking of alternatives (or additions) to discover queues we could parse $conf to look for "queue_class_%" variables to get a list of queue names and queue classes (or look in variables?) which would cater for scenarios where queues have been implemented without the hook_queue_info but still need to be discovered?

Be interested in thoughts/feedback - I'm more than happy to work on a patch for this, either as a traditional patch or I could create a new sandbox and create a new branch to work on for review.

Thanks
Tom

Comments

coltrane’s picture

Thanks Tom, good ideas. I agree, we should provide functionality based on the particular queue class it is and the possible backends.

I think if parsing $conf queue class variables can be avoided we should, I'd rather rely on hook_queue_info() (and hook_cron_queue_info()) for how to handle each queue. That'll mean ignoring queues that don't implement either of those hooks. Perhaps queue_ui could implement on behalf of core's queues?

Either a patch or branch is fine, I've granted you VCS permissions to Queue UI.

tsphethean’s picture

Ok great, thanks. I've created a new 7.x-2.x branch to work in, and we can discuss changes in there prior to any releases.

tsphethean’s picture

I've got some work going on this in the 7.x-2.x branch at http://drupalcode.org/project/queue_ui.git/tree/refs/heads/7.x-2.x and would be interested in any feedback.

Given the leanings toward OO that D8 is going to be taking, and that the hook_cron_queue_info in core is being renamed to hook_queue_info, I've implemented the ability to provide queue inspection as a QueueUI interface, which each queue backend can then implement as an additional class (i.e. QueueUISystemQueue). Hopefully this will make upgrading to D8 easier in a few months time.

Currently, this is just providing the "inspect" method, which allows any class to provide a means for viewing the items in a given queue, I still need to figure out how I'm going to dynamically expose additional menu callbacks for viewing the data, releasing and deleting of an individual queue item.

tsphethean’s picture

The Queue Manager sandbox functionality has been added to the Queue UI 7.x-2.x branch and is available in the latest dev release: http://drupal.org/node/2001996

tsphethean’s picture

Status: Active » Needs review
tsphethean’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Closed (fixed)

Closing this as it's been in the 7.x.-2.x branch for a few months now.