Patch does some cleanup, removing unused files (non-existing Test, and a returned early JS)
Pass the item-ID and end-time to the worker callback, so they can act upon it. My use case is Message-subscribe, where I want the worker to manage itself it's own claimed item.
Add an example module, to helps developers understand what happens when they drush advancedqueue-process-queue --all

Comments

amitaibu’s picture

Status: Needs review » Needs work

Going to do some more work on it, to pass more info to the worker callback.

amitaibu’s picture

Status: Needs work » Needs review
StatusFileSize
new14.8 KB
amitaibu’s picture

StatusFileSize
new11.97 KB
new21.4 KB

Note this API change, which IMO is a nicer DX.

@@ -108,25 +109,24 @@ function drush_advancedqueue_process_item($queue, $queue_name, $queue_info, $ite
     // callback.
     $output = $function($item, $end_time);
     if (is_array($output)) {
-      $item->status = $output[0];
-      $item->result = $output[1];
+      $item->status = $output['status'];
+      $item->result = $output['result'];
     }
amitaibu’s picture

Status: Needs review » Fixed

Cleaned up code a bit more, and committed.

Status: Fixed » Closed (fixed)

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