Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
phalanx - Commitdiff - ViewGit - Blue Static

Run the pump in the Executor

Robert Sesek [2011-02-13 15:18]
Run the pump in the Executor
diff --git a/tasks/executor.php b/tasks/executor.php
index 10fa7b7..694ce93 100644
--- a/tasks/executor.php
+++ b/tasks/executor.php
@@ -73,12 +73,18 @@ class Executor
         if ($this->delegate)
             $this->delegate->OnCreateRequest($request);

-        // Dispatch the Request.
+        // Dispatch the Request. Note that |$response| is not filled out until
+        // the pump runs the task.
         $response = $this->dispatcher->DispatchRequest($request);

         if ($this->delegate)
             $this->delegate->OnCreatedResponse($response);

+        TaskPump::Pump()->Loop();
+
+        if ($this->delegate)
+            $this->delegate->OnRanTaskPump();
+
         // TODO: invoke the output handler
     }
 }
@@ -90,6 +96,8 @@ interface ExecutorDelegate
     public function OnCreateRequest(Request $request);

     public function OnCreatedResponse(Response $response);
+
+    public function OnRanTaskPump();
 }

 class ExecutorException extends \Exception {}