gianarb/lean-queue

0.2.0 2016-11-14 11:45 UTC

This package is auto-updated.

Last update: 2024-10-15 17:14:32 UTC


README

Master: Build Status Develop: Build Status

Dependency Status Code Climate

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