AMQP Workers library
All this library does is providing more fluent experience with AMQP. Original phpamqplib has very strange approach to its functions declarations.
I decided to create a tiny layer of abstraction which provides a bit more flexible interface:
$consumer = Consumer::factory($connection) ->withQueue(new Queue('consume_from')) ->withWorker($worker) ->run();
That is very short basic setup,
Consumer has much more functions. Read the manual for more detailed description.
- More fluent and flexible interface than original php-amqplib library;
- Very lazy approach, amqp-related stuff is called only when you call
composer require enl/amqp-workers
// Create AMQPConnection $connection = new AMQPLazyConnection(); // We're using static `factory` function only for convenience with fluent interface $consumer = Consumer::factory($connection) // set queue definition. all parameters are default ->withQueue(new Queue('consume_from')) // Worker is an object of WorkerInterface which handles given message body ->withWorker($worker) // declare and start consuming the queue ->run();
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.