2017 © Pedro Peláez
 

library flatfishqueue

Queue Library for RabbitMQ or SQS

image

roryy/flatfishqueue

Queue Library for RabbitMQ or SQS

  • Tuesday, July 31, 2018
  • by roryy
  • Repository
  • 2 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Traffic jam

PHP queue library for RabbitMQ. It's possible to add more queue types like SQS, (*1)

Please do not use in production as BC breaks can occur before reaching version 1.0., (*2)

Installation

composer require roryy/trafficjam "0.6.*"

Usage

To use the Trafficjam library in combination with Rabbitmq, you have to setup your Rabbitmq credentials first., (*3)

Like this:, (*4)

use Trafficjam\Infrastructure\RabbitMq\Connection;
use Trafficjam\Infrastructure\RabbitMq\RabbitMqQueue;

$connection = new Connection('localhost', 5672, 'guest', 'guest');

Then create a queue like this:, (*5)

$queue = new RabbitMqQueue($connection, $queueName, $durable, $exchange, $routingKey);
$trafficjam = new Trafficjam($queue);

To publish one or more messages to your queue:, (*6)

$trafficjam->publish('test 1');
$trafficjam->publish('test 2');

And consume (with a callback), don't forget to acknowledge, (*7)

$trafficjam->consume(function (Consumable $msg) use ($trafficjam) {
    $message = $msg->getMessage();
    echo ' msg: '. $message .PHP_EOL;

    $trafficjam->acknowledge($msg);
});

This will output:, (*8)

test 1
test 2

Future

In the future this library will also going to support SQS., (*9)

Contribute

If you want to use another queuing system besides RabbitMQ then please implement the Queue interface when creating your own. Please create a pull request., (*10)

License

Trafficjam is licensed under the MIT License. See the bundled LICENSE file for details., (*11)

The Versions

31/07 2018

dev-update-php-71

dev-update-php-71

Queue Library for RabbitMQ or SQS

  Sources   Download

MIT

The Requires

 

The Development Requires

27/08 2017

dev-master

9999999-dev

Queue Library for RabbitMQ or SQS

  Sources   Download

MIT

The Requires

 

The Development Requires

27/08 2017

v0.2.0

0.2.0.0

Queue Library for RabbitMQ or SQS

  Sources   Download

MIT

The Requires

 

The Development Requires

27/08 2017

dev-refactor-queue

dev-refactor-queue

Queue Library for RabbitMQ or SQS

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2015

v0.1.2

0.1.2.0

Queue Library with RabbitMQ

  Sources   Download

The Requires

 

22/06 2015

v0.1.0

0.1.0.0

Queue Library with RabbitMQ

  Sources   Download

The Requires

 

22/06 2015

v0.1.1

0.1.1.0

Queue Library with RabbitMQ

  Sources   Download

The Requires

 

22/06 2015

dev-development

dev-development

Queue Library with RabbitMQ

  Sources   Download

The Requires