/** * Queue a new e-mail message for sending after (n) seconds. * * @param int $delay * @param string|array $view * @param array $data * @param \Closure|string $callback * @param string|null $queue * @return mixed */ public function later($delay, $view, array $data = [], $callback = null, $queue = null) { if ($view instanceof MailableContract) { return $view->later($delay, $this->queue); } return $this->queue->laterOn($queue, $delay, new Jobs\HandleQueuedMessage($view, $data, $callback)); }
/** * Push the command onto the given queue instance. * * @param \Illuminate\Contracts\Queue\Queue $queue * @param mixed $command * @return mixed */ protected function pushCommandToQueue($queue, $command) { if (isset($command->queue, $command->delay)) { return $queue->laterOn($command->queue, $command->delay, $command); } if (isset($command->queue)) { return $queue->pushOn($command->queue, $command); } if (isset($command->delay)) { return $queue->later($command->delay, $command); } return $queue->push('Ahead4\\Bus\\CallQueuedHandler@call', ['pipes' => $this->pipes, 'command' => serialize($command)]); }
/** * Push the command onto the given queue instance. * * @param \Illuminate\Contracts\Queue\Queue $queue * @param mixed $command * @return mixed */ protected function pushCommandToQueue($queue, $command) { if (isset($command->queue, $command->delay)) { return $queue->laterOn($command->queue, $command->delay, $command); } if (isset($command->queue)) { return $queue->pushOn($command->queue, $command); } if (isset($command->delay)) { return $queue->later($command->delay, $command); } return $queue->push($command); }