當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Queue::pushOn方法代碼示例

本文整理匯總了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));
 }
開發者ID:bryanashley,項目名稱:framework,代碼行數:16,代碼來源:Mailer.php

示例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;
 }
開發者ID:HydrefLab,項目名稱:laravel-mailer,代碼行數:17,代碼來源:Mailer.php

示例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)]);
 }
開發者ID:ahead4,項目名稱:bus,代碼行數:20,代碼來源:Dispatcher.php

示例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);
 }
開發者ID:focuslife,項目名稱:v0.1,代碼行數:20,代碼來源:Dispatcher.php

示例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);
 }
開發者ID:HydrefLab,項目名稱:laravel-mailer,代碼行數:19,代碼來源:MailerSpec.php

示例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);
     }
 }
開發者ID:edvinaskrucas,項目名稱:counter-laravel,代碼行數:15,代碼來源:Base.php


注:本文中的Illuminate\Contracts\Queue\Queue::pushOn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。