Пример #1
0
 /**
  * Выполнить вызываемый метод
  *
  * @param $message
  * @return mixed
  */
 public function callback($message)
 {
     $startTime = microtime(true);
     $data = $this->serializer->unSerialize($message);
     $result = call_user_func($this->callback, $data);
     $this->totalWorkTime += microtime(true) - $startTime;
     return $result;
 }
Пример #2
0
 public function publish($message, Config $config = null)
 {
     $queueConfig = clone $this->config;
     if ($config) {
         $queueConfig->merge($config);
     }
     return $this->driver->send($this->serializer->serialize($message), $queueConfig);
 }