gianarb / lean-queue
Fund package maintenance!
gianarb
0.2.0
2016-11-14 11:45 UTC
Requires
- aws/aws-sdk-php: ~2
Requires (Dev)
- phpspec/phpspec: ~2.0
- phpunit/phpunit: ~4.0
README
lean queue system, receive and send messages for different queue adapters.
For now supports ArrayAdapter
and AwsSqs
Send messages in queue
<?php $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'}");
Receive and Delete messages
<?php $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);
Install
php composer.phar require "gianarb\lean-queue"
Contribute
Try it and open issues or pull requests! ;)
vendor/bin/phpspec run