Miguel Dantas 630a578e1d [COMPOSER] Added predis/predis and updated packages | 5 years ago | |
---|---|---|
.. | ||
src | 5 years ago | |
tests | 5 years ago | |
.gitignore | 5 years ago | |
.travis.yml | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
composer.json | 5 years ago | |
composer.lock | 5 years ago | |
phpunit.xml.dist | 5 years ago |
queue-interop tries to identify and standardize a common way for PHP programs to create, send, receive and read MQ messages to achieve interoperability.
Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.
If PHP projects that provide queue implementations begin to adopt these common standards, then PHP applications and projects that use MQs can depend on the common interfaces instead of specific implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume any MQ transport implementation that can be adapted to these interfaces.
The work done in this project is not officially endorsed by the PHP-FIG. We adhere to the spirit and ideals of PHP-FIG, and hope this project will pave the way for one or more future PSRs.
The Queue Interop project started in the summer of 2016, almost two years ago. Since then It has been well-tried by many developers. A lot of companies use it in production.
It is time to settle a date of a stable release and possibly some intermediate steps towards it:
You can install this package through Composer:
# Install a Queue Interop compatible transport, for example
$ composer require enqueue/fs
Send a message:
<?php
use Enqueue\Fs\FsConnectionFactory;
$context = (new FsConnectionFactory())->createContext();
$context->createProducer()->send(
$context->createQueue('aQueue'),
$context->createMessage('aBody')
);
Consume a message:
<?php
use Enqueue\Fs\FsConnectionFactory;
$context = (new FsConnectionFactory())->createContext();
$consumer = $consumer->createConsumer($context->createQueue('aQueue'));
$timeout = 5000; // 5sec
if ($message = $consumer->receive($timeout)) {
// process the message.
$consumer->acknowledge($message);
}
Find out more here:
There is AMQP interop built on top of Queue Interop. It is completly compatible with queue interop and only adds some AMQP specific features:
Everyone is welcome to join and contribute.
The general workflow looks like this:
We try to not break BC by creating new interfaces instead of editing existing ones.
While we currently work on interfaces, we are open to anything that might help towards interoperability, may that be code, best practices, etc.