Esempio n. 1
0
 /**
  * run worker处理方法 
  * 
  * @param string $payload 队列数据 
  * @param string $log 
  * @param string $job 任务对象
  * @param string $tube 管道对象
  * @access public
  * @return void
  */
 public function run($payload, &$log, $job, $tube)
 {
     $this->job = $job;
     $this->tube = $tube;
     try {
         // 业务逻辑代码
         // 涉及到的请求分发
         $sendRequest = new Simple('method', 'module', 'controller', 'action', $payload);
         $result = $this->app->getDispatcher()->dispatch($sendRequest);
         $result = json_decode($result->getBody(), true);
     } catch (Exception $e) {
         return 'error';
     }
 }