本文整理汇总了PHP中Illuminate\Contracts\Queue\Queue::pushOn方法的典型用法代码示例。如果您正苦于以下问题:PHP Queue::pushOn方法的具体用法?PHP Queue::pushOn怎么用?PHP Queue::pushOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Queue\Queue
的用法示例。
在下文中一共展示了Queue::pushOn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: queue
/**
* Queue a new e-mail message for sending.
*
* @param string|array $view
* @param array $data
* @param \Closure|string $callback
* @param string|null $queue
* @return mixed
*/
public function queue($view, array $data = [], $callback = null, $queue = null)
{
if ($view instanceof MailableContract) {
return $view->queue($this->queue);
}
return $this->queue->pushOn($queue, new Jobs\HandleQueuedMessage($view, $data, $callback));
}
示例2: queue
/**
* @param string $queue
* @param string|null $subject
* @param string|null $template
* @return bool
*/
public function queue($queue, $subject = null, $template = null)
{
if (null !== $subject) {
$this->setSubject($subject);
}
if (null !== $template) {
$this->setTemplate($template);
}
$this->queue->pushOn($queue, new Job($this->getData()));
return true;
}
示例3: pushCommandToQueue
/**
* 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)]);
}
示例4: pushCommandToQueue
/**
* 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);
}
示例5: it_pushes_mail_to_queue
public function it_pushes_mail_to_queue(Queue $queue)
{
$recipient = new Recipient('Jane Doe', 'janedoe@example.com');
$variableOne = new Variable('global_one', 'Example');
$variableTwo = new Variable('global_two', 'Another example');
$variableThree = new Variable('local', 'Yet another example');
$attachment = new Attachment('text/csv', 'test.csv', 'example;test;');
$data = ['from_name' => 'John Doe', 'from_email' => 'johndoe@example.com', 'subject' => 'Example subject', 'template' => 'example template', 'recipients' => [new Recipient('Jane Doe', 'janedoe@example.com')], 'global_vars' => ['global_one' => ['name' => 'GLOBAL_ONE', 'content' => 'Example'], 'global_two' => ['name' => 'GLOBAL_TWO', 'content' => 'Another example']], 'local_vars' => ['janedoe@example.com' => ['local' => ['name' => 'LOCAL', 'content' => 'Yet another example']]], 'headers' => [], 'attachments' => [['type' => 'text/csv', 'name' => 'test.csv', 'content' => 'ZXhhbXBsZTt0ZXN0Ow==']]];
$this->setSubject('Example subject');
$this->setTemplate('example template');
$this->addRecipient($recipient);
$this->addGlobalVariable($variableOne);
$this->addGlobalVariable($variableTwo);
$this->addLocalVariable($recipient, $variableThree);
$this->addAttachment($attachment);
$job = new Job($data);
$queue->pushOn('mandrill', $job)->shouldBeCalled();
$this->queue('mandrill')->shouldReturn(true);
}
示例6: queue
/**
* Push command to queue.
*
* @param \Illuminate\Contracts\Queue\Queue $queue
* @param \Krucas\Counter\Integration\Laravel\Commands\Base $command
* @return void
*/
public function queue(Queue $queue, Base $command)
{
if (!is_null($this->queue)) {
$queue->pushOn($this->queue, $command);
} else {
$queue->push($command);
}
}