Illuminate\Bus\Dispatcher::dispatchToQueue PHP Метод

dispatchToQueue() публичный метод

Dispatch a command to its appropriate handler behind a queue.
public dispatchToQueue ( mixed $command ) : mixed
$command mixed
Результат mixed
    public function dispatchToQueue($command)
    {
        $queue = call_user_func($this->queueResolver);
        if (!$queue instanceof Queue) {
            throw new RuntimeException('Queue resolver did not return a Queue implementation.');
        }
        if (method_exists($command, 'queue')) {
            return $command->queue($queue, $command);
        } else {
            return $this->pushCommandToQueue($queue, $command);
        }
    }

Usage Example

Пример #1
0
 /**
  * Dispatch a command to its appropriate handler behind a queue.
  *
  * @param mixed $command
  * @return mixed 
  * @throws \RuntimeException
  * @static 
  */
 public static function dispatchToQueue($command)
 {
     return \Illuminate\Bus\Dispatcher::dispatchToQueue($command);
 }