本文整理汇总了PHP中Queue::pushRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP Queue::pushRaw方法的具体用法?PHP Queue::pushRaw怎么用?PHP Queue::pushRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Queue
的用法示例。
在下文中一共展示了Queue::pushRaw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendmail
public function sendmail()
{
$users_checked = Input::get('users');
if (is_array($users_checked)) {
$queue_name = $this->option('queue_name');
$payload = array('ids' => $users_checked);
$mgs_id = Queue::pushRaw($payload, $queue_name);
$response = array('status' => 'success', 'msg' => "Task id = {$mgs_id}");
} else {
$response = array('status' => 'failed', 'msg' => 'No users checked');
}
return \Response::json($response);
}
示例2: fire
public function fire()
{
$queue_name = $this->option('queue_name');
// //Post message via IronMQ lib - https://github.com/iron-io/iron_mq_php
// $mq = new \IronMQ(array(
// 'token' => Config::get('queue.connections.iron.token', 'xxx'),
// 'project_id' => Config::get('queue.connections.iron.project', 'xxx')
// ));
// //Every payload must be crypted, worker will decrypt it.
// $mq->postMessages($queue_name, array(
// $this->encryptPayload("This is Hello World payload_1"),
// $this->encryptPayload("This is Hello World payload_2")
// )
// );
//Post message via Laravel Queue class
Queue::pushRaw("This is Hello World payload :)", $queue_name);
$this->info("<info>Message pushed to the <comment>{$queue_name}</comment> queue.</info>");
}
示例3: fire
public function fire()
{
$queue_name = $this->option('queue_name');
$this->info(Queue::pushRaw(array('ids' => array("1,2")), $queue_name));
}