本文整理汇总了PHP中Illuminate\Queue\QueueManager::push方法的典型用法代码示例。如果您正苦于以下问题:PHP QueueManager::push方法的具体用法?PHP QueueManager::push怎么用?PHP QueueManager::push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Queue\QueueManager
的用法示例。
在下文中一共展示了QueueManager::push方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: queue
/**
* 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);
}
}
示例2: push
/**
* 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);
}
示例3: process
/**
* {@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);
}
示例4: install
/**
* Installs dependencies.
*
* @return boolean
*/
public function install()
{
if (!$this->isInstalling()) {
$this->queue->push(ComposerInstallJob::class);
return true;
} else {
return false;
}
}
示例5: send
/**
* {@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;
}
示例6: queue
/**
* 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);
}
示例7: queue
/**
* 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);
}
示例8: process
/**
* {@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);
}
示例9: queue
/**
* 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);
}
示例10: queue
/**
* 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);
}
}