Claim items without lease time and view queue contents.

Comments

coltrane’s picture

Or maybe with lease time?

BenK’s picture

Interesting idea for a module.... just subscribing so I can keep track of it. Looking forward to trying it out.

coltrane’s picture

Hmmn, what if queue info hooks defined object translation for use when viewing the content? So, queue_ui would list each item in the queue and if the queue had defined an object translation function it would invoke it, otherwise it just prints the serialized content.

mr.baileys’s picture

As I'm currently using this as a troubleshooting tool, I'd be interested to see how you tackle this one, since:

a) Some queue implementations such as BatchQueue do not have a notion of lease time, so using claimItem() + releaseItem() as a way to "peek" won't work always work I think (in the case of BatchQueue, you would end up with the same item over and over again);
b) Queues can use all sorts of back-ends, so a simple SQL query won't do either;
c) Some queue implementations have a getAllItems() member function. Some...
d) Default queue implementations do not guarantee the order in which items are retrieved.

The only way I can think of (and which is pretty invasive) is to actually walk the queue, deleting (claimItem + deleteItem) and displaying items as you go, and then reinserting (insertItem) these items afterwards.

On the other hand, I might have missed some really obvious way to do this :)

coltrane’s picture

Yeah, I build queue_ui out of a specific need with the database queue, but it doesn't work necessarily for other implementations. I haven't solved viewing queue content yet, at least via this module, rather I just peak into the table myself via phpmyadmin or the cmd line.

geerlingguy’s picture

Subscribe.

cyberwolf’s picture

Subscribing.

tsphethean’s picture

Just realised I've probably created a duplicate issue with my post at http://drupal.org/node/1913330 which proposes how to do queue item viewing for DB queues.

For other backends, I think the queue implementing class would need to expose a mechanism to viewing queue data, as that class will include any relevant libraries for talking to the queue backend. For example, in the STOMP module (http://drupal.org/project/stomp), an additional method could be implemented to expose STOMP library calls to look at specific item data, but im not convinced all queues will provide this mechanism

tsphethean’s picture

Status: Active » Needs review

This feature has been added to the 7.x-2.x branch and is available in the latest dev release: http://drupal.org/node/2001996

tsphethean’s picture

Status: Needs review » Closed (fixed)