Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291669

Queue system createItem() should return ID, and $item properties should be documented

$
0
0

Discussion with Queue system maintainer Mark Sonnabaum while trying to use the core queue API for more complex tasks, I'm running into a couple bugs/flaws.

The more annoying is that the createItem() method returns a boolean instead of the ID of the queue item, for no useful reason. This makes it hard to create an item in the queue an watch for it's appearance again in a worker function, for example.

All likely back-ends (SQL, redis, beanstalk) support returning an ID, and the change from bool to int/FALSE shouldn't break any existing code.
https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt#L155
http://drupalcode.org/project/redis_queue.git/blob/refs/heads/7.x-1.x:/r...

The other problem is that the properties of the $item fro claimItem are not clearly specified or documented. It's not even documented that the data is in $item-data! We should document a minimal set of properties as part of the APi so code can know what to expect to be present in all cases.

These changes should be back-portable to 7.x


Viewing all articles
Browse latest Browse all 291669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>