ソースを参照

Set our $context wrapped in array to context field of event object.

Michael Sivolobov 10 年 前
コミット
05e63327c5
1 ファイル変更4 行追加1 行削除
  1. 4 1
      Dispatcher/GearmanCallbacksDispatcher.php

+ 4 - 1
Dispatcher/GearmanCallbacksDispatcher.php

@@ -90,9 +90,12 @@ class GearmanCallbacksDispatcher extends AbstractGearmanDispatcher
      *
      * @see http://www.php.net/manual/en/gearmanclient.setcompletecallback.php
      */
-    public function assignCompleteCallback(GearmanTask $gearmanTask)
+    public function assignCompleteCallback(GearmanTask $gearmanTask, $contextReference = null)
     {
         $event = new GearmanClientCallbackCompleteEvent($gearmanTask);
+        if (!is_null($contextReference)) {
+            $event->setContext($contextReference);
+        }
         $this->eventDispatcher->dispatch(
             GearmanEvents::GEARMAN_CLIENT_CALLBACK_COMPLETE,
             $event