Last active
May 19, 2017 20:51
-
-
Save raulp/6050423 to your computer and use it in GitHub Desktop.
Laravel Queue::push return job id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For IronIO | |
// file src/Illuminate/Queue/IronQueue.php line 64 | |
public function push($job, $data = '', $queue = null) | |
{ | |
$payload = $this->createPayload($job, $data); | |
$response = $this->iron->postMessage($this->getQueue($queue), $payload); | |
return $response->id; | |
} | |
// For Amazon SQS | |
// file src/Illuminate/Queue/SqsQueue.php line 43 | |
public function push($job, $data = '', $queue = null) | |
{ | |
$payload = $this->createPayload($job, $data); | |
$response = $this->sqs->sendMessage(array('QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload)); | |
return $response->get('MessageId'); | |
} | |
// For Beanstalkd server | |
// file src/Illuminate/Queue/BeanstalkdQueue.php line 44 | |
public function push($job, $data = '', $queue = null) | |
{ | |
$payload = $this->createPayload($job, $data); | |
return $this->pheanstalk->useTube($this->getQueue($queue))->put($payload); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment