Now we have moved to psr-0 and make heavy use of classes/namespaces etc... it would make sense to allow the 'worker calback' key in hook_queue_info to process any php callable and not just a function.

Files: 
CommentFileSizeAuthor
#7 1993100-7.patch1.85 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 55,021 pass(es).
[ View ]
#7 interdiff-1993100-7.txt563 bytesdamiankloip
#4 1993100-4.patch1.83 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 55,600 pass(es).
[ View ]
#4 interdiff-1993100-4.txt1.14 KBdamiankloip
d8.queue-info-callable.patch708 bytesdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 55,577 pass(es).
[ View ]

Comments

aspilicious’s picture

Status:Needs review» Reviewed & tested by the community

Must come back green!

chx’s picture

Agreed.

alexpott’s picture

Status:Reviewed & tested by the community» Needs work

We should update the docs too then... in system.api.php...

*   An associative array where the key is the queue name and the value is
*   again an associative array. Possible keys are:
*   - 'worker callback': The name of the function to call. It will be called
*     with one argument, the item created via
*     Drupal\Core\Queue\QueueInterface::createItem() in hook_cron().
damiankloip’s picture

Status:Needs work» Needs review
StatusFileSize
new1.14 KB
new1.83 KB
PASSED: [[SimpleTest]]: [MySQL] 55,600 pass(es).
[ View ]

Yep, good point. Let's update the actual docs.

damiankloip’s picture

This still applies fine, and is a really small change - any chance this can get in?

dawehner’s picture

Status:Needs review» Needs work

On views we had an issue with call_user_func on php 5.4, see #1933290: Saving anything on handlers isn't stored properly
so call_user_func_array should be used instead. In this case it works fine as data is an object, but for just arrays in the queue we have a problem

damiankloip’s picture

Status:Needs work» Needs review
StatusFileSize
new563 bytes
new1.85 KB
PASSED: [[SimpleTest]]: [MySQL] 55,021 pass(es).
[ View ]

That's a very good point.

dawehner’s picture

Status:Needs review» Reviewed & tested by the community

Let's get that.

ParisLiakos’s picture

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed 5ecc704 and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.