Skip to content

Instantly share code, notes, and snippets.

@ridwanbejo
Last active June 12, 2020 00:13
Show Gist options
  • Save ridwanbejo/bc5e9203f38511109f68780c32a5b7ee to your computer and use it in GitHub Desktop.
Save ridwanbejo/bc5e9203f38511109f68780c32a5b7ee to your computer and use it in GitHub Desktop.
laravel-queue-sqs - HelloWorldJob.php v2
<?php
namespace App\Jobs;
class HelloWorldJob extends Job
{
protected $uuid;
protected $message;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($uuid, $message)
{
$this->uuid = $uuid;
$this->message = $message;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
echo "Running an hello world job ...\n";
echo "Queue Broker: AWS SQS\n";
echo "Processing message: ";
echo $this->uuid->toString()."\n";
echo $this->message."\n";
echo "Finished at: ".date("Y-m-d H:i:s")."\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment