Exemple #1
0
 /**
  * Queue a new e-mail message for sending.
  *
  * @param  string  $queue
  * @return void
  */
 public function queue($queue = null)
 {
     if ($this->queueManager) {
         $swiftMessage = $this->message->getSwiftMessage();
         $this->queueManager->push(new SendEmailJob($swiftMessage), $queue);
     }
 }
 /**
  * Pushes a job into a specific queue connection.
  *
  * If you are using multiple SQS queues, this method might be useful.
  * Instead of having to provide the whole queue URL every time you want to
  * push a job into it, you just provide the name of the queue connection
  * as set in the configuration file.
  *
  * @param mixed $job
  * @param array $data
  * @param string $connection Name of the connection
  * @param string $queue
  *
  * @return mixed
  */
 public function push($job, array $data, $connection = null, $queue = null)
 {
     if ($connection == null) {
         return $this->manager->push($job, $data, $queue);
     }
     $connection = $this->manager->connection($connection);
     return $connection->push($job, $data, $queue);
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  *
  * @throws \RuntimeException Thrown if the queue has not been set.
  */
 public function process($url, $data, array $headers = [])
 {
     if (empty($this->queue)) {
         throw new RuntimeException('Queue not set');
     }
     $data = ['url' => $url, 'data' => $data, 'headers' => $headers, 'transport' => $this->transport->toArray()];
     $this->queue->push('rcrowe\\Raven\\Handler\\Laravel\\Job', $data);
 }
 /**
  * Installs dependencies.
  *
  * @return boolean
  */
 public function install()
 {
     if (!$this->isInstalling()) {
         $this->queue->push(ComposerInstallJob::class);
         return true;
     } else {
         return false;
     }
 }
 /**
  * {@inheritdoc}
  */
 public function send($data)
 {
     // send error now if queue not set
     if (is_null($this->queue)) {
         return $this->sendError($data);
     }
     // put the job into the queue
     // Sync connection will sent directly
     // if failed to add job to queue send it now
     try {
         $this->queue->push('Clowdy\\Raven\\Job', $data, $this->customQueue);
     } catch (Exception $e) {
         $this->sendError($data);
     }
     return;
 }
Exemple #6
0
 /**
  * Queues a SMS message.
  *
  * @param string $view The desired view.
  * @param array $data An array of data to fill the view.
  * @param  \Closure|string $callback The callback to run on the Message class.
  * @param null|string $queue The desired queue to push the message to.
  * @return void
  */
 public function queue($view, $data, $callback, $queue = null)
 {
     $callback = $this->buildQueueCallable($callback);
     $this->queue->push('sms@handleQueuedMessage', compact('view', 'data', 'callback'), $queue);
 }
Exemple #7
0
 /**
  * Queue a new e-mail message for sending.
  *
  * @param  string|array  $view
  * @param  array   $data
  * @param  \Closure|string  $callback
  * @param  string  $queue
  * @return mixed
  */
 public function queue($view, array $data, $callback, $queue = null)
 {
     $callback = $this->buildQueueCallable($callback);
     return $this->queue->push('laravel-swiftmailer.mailer@handleQueuedMessage', compact('view', 'data', 'callback'), $queue);
 }
Exemple #8
0
 /**
  * {@inheritdoc}
  */
 public function process(Client $client, array $message)
 {
     $data = array('message' => $this->encodeMessage($message), 'client' => Client::getClientOptions($client), 'transport' => $this->getTransport()->toArray());
     $this->queue->push('rcrowe\\Raven\\Handler\\Laravel\\Job', $data);
 }
 /**
  * Send the message and options to HipchatQueueNotifier
  * so that we're not trying to process the API call to
  * HipChat synchronously.
  *
  * @param string $message
  * @param array $options Same options as class constructor
  * @return mixed
  */
 protected function queue($message, array $options)
 {
     $data = ['message' => $message, 'options' => $options];
     return $this->queue->push(HipchatQueueNotifier::class, $data);
 }
Exemple #10
0
 /**
  * Queue a new e-mail message for sending.
  *
  * @param  string  $queue
  * @return void
  */
 public function queue($queue = null)
 {
     if ($this->queue) {
         $this->queue->push('mailman@handleQueuedMessage', array('message' => serialize($this->getMessageForSending())), $queue);
     }
 }