I think I was too worried about conflicts if two different subqueues tried to claim the same item, but this makes the code forcibly dependent on the database queues. It should be entirely possible to just not generate the unique subqueue names and process the queues like normal.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new7.6 KB

Ok let's try this.

dave reid’s picture

StatusFileSize
new10.46 KB

Final version.cancel

dave reid’s picture

Status: Needs review » Closed (won't fix)

Nevermind, it looks like this actually messes with execution order. Using this code only the first subqueue is able to grab items, and the second subqueue queue keeps failing the claimItem() method and ends up processing nothing.

dave reid’s picture

Status: Closed (won't fix) » Active

Re-investigating this...