PHP code example of gianarb / lean-queue
1. Go to this page and download the library: Download gianarb/lean-queue library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gianarb / lean-queue example snippets
$client = \Aws\Sqs\SqsClient::factory();
$queue = new \GianArb\LeanQueue\Queue("https://sqs.eu-west-1.amazonaws.com/xxxxxx/test-php");
$queue->setAdapter(new \GianArb\LeanQueue\Adapter\AwsAdapter($client));
$queue->send("{'example': '2121'}");
$queue = new \GianArb\LeanQueue\Queue("https://sqs.eu-west-1.amazonaws.com/xxxxx/test-php");
$queue->setAdapter(new \GianArb\LeanQueue\Adapter\AwsAdapter($client));
list($receipt, $message) = $queue->receive();
$queue->delete($receipt);
bash
php composer.phar