corley/queue-sqs

1.0.0 2017-01-21 12:04 UTC

This package is not auto-updated.

Last update: 2024-10-26 22:34:41 UTC


README

To use this package you need Corley\Queue\Queue and the AWS PHP SDK v2 or v3

Build Status

composer require corley/queue:~1

Remember to install your AWS SDK

AWS V2

composer require aws/aws-sdk-php:~2

AWS V3

composer require aws/aws-sdk-php:~3

Use as adapter

Create the adapter

with v2

use Corley\Queue\AWS\V2;

$adapter = new V2\SQS($client);

or v3

use Corley\Queue\AWS\V3;

$adapter = new V3\SQS($client);

Set as usual

use Corley\Queue\Queue;

$queue = new Queue("https://sqs.aws.amazon.com/155555555555/test", $adapter);
$queue->send(json_encode(["test" => "ok"]));

list($receipt, $message) = $queue->receive();
$message = json_decode($message, true);

$queue->delete($receipt);