Skip to content

Migrate to queue interop #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ install:

script:
# misssing pkg/amqp-ext pkg/job-queue pkg/redis
- if [ "$PHPSTAN" = true ]; then php -d memory_limit=512M bin/phpstan analyse -l 1 -c phpstan.neon pkg/amqp-ext pkg/async-event-dispatcher pkg/dbal pkg/enqueue pkg/enqueue-bundle pkg/fs pkg/gearman pkg/job-queue pkg/null pkg/pheanstalk pkg/psr-queue pkg/redis pkg/simple-client pkg/sqs pkg/stomp pkg/test; fi
- if [ "$PHPSTAN" = true ]; then php -d memory_limit=512M bin/phpstan analyse -l 1 -c phpstan.neon pkg/amqp-ext pkg/async-event-dispatcher pkg/dbal pkg/enqueue pkg/enqueue-bundle pkg/fs pkg/gearman pkg/job-queue pkg/null pkg/pheanstalk pkg/redis pkg/simple-client pkg/sqs pkg/stomp pkg/test; fi
- if [ "$PHP_CS_FIXER" = true ]; then IFS=$'\n'; COMMIT_SCA_FILES=($(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")); unset IFS; fi
- if [ "$PHP_CS_FIXER" = true ]; then ./bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no --path-mode=intersection -- "${COMMIT_SCA_FILES[@]}"; fi
- if [ "$UNIT_TESTS" = true ]; then bin/phpunit --exclude-group=functional; fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is where all development happens. The repository provides a friendly enviro
Features:

* [Feature rich](docs/quick_tour.md).
* [JMS](https://docs.oracle.com/javaee/7/api/javax/jms/package-summary.html) like transport [abstraction](https://github.com/php-enqueue/psr-queue).
* Implements [JMS](https://docs.oracle.com/javaee/7/api/javax/jms/package-summary.html) like transports based on a[queue-interop](https://github.com/queue-interop/queue-interop) interfaces.
* Supported transports [AMQP](docs/transport/amqp.md) (RabbitMQ, ActiveMQ), [Beanstalk](docs/transport/pheanstalk.md), [STOMP](docs/transport/stomp.md), [Amazon SQS](docs/transport/sqs.md), [Redis](docs/transport/redis.md), [Gearman](docs/transport/gearman.md), [Doctrine DBAL](docs/transport/dbal.md), [Filesystem](docs/transport/filesystem.md), [Null](docs/transport/null.md).
* [Symfony bundle](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/bundle/quick_tour.md)
* [Magento1 extension](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/magento/quick_tour.md)
Expand Down
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi

CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`

for REMOTE in origin psr-queue stomp amqp-ext pheanstalk gearman sqs fs redis dbal null enqueue simple-client enqueue-bundle job-queue test async-event-dispatcher
for REMOTE in origin stomp amqp-ext pheanstalk gearman sqs fs redis dbal null enqueue simple-client enqueue-bundle job-queue test async-event-dispatcher
do
echo ""
echo ""
Expand Down
2 changes: 0 additions & 2 deletions bin/subtree-split
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function remote()
git remote add $1 $2 || true
}

remote psr-queue git@github.com:php-enqueue/psr-queue.git
remote enqueue git@github.com:php-enqueue/enqueue.git
remote simple-client git@github.com:php-enqueue/simple-client.git
remote stomp git@github.com:php-enqueue/stomp.git
Expand All @@ -60,7 +59,6 @@ remote job-queue git@github.com:php-enqueue/job-queue.git
remote test git@github.com:php-enqueue/test.git
remote async-event-dispatcher git@github.com:php-enqueue/async-event-dispatcher.git

split 'pkg/psr-queue' psr-queue
split 'pkg/enqueue' enqueue
split 'pkg/simple-client' simple-client
split 'pkg/stomp' stomp
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"minimum-stability": "stable",
"require": {
"php": ">=5.6",
"enqueue/psr-queue": "*@dev",
"enqueue/enqueue": "*@dev",
"enqueue/stomp": "*@dev",
"enqueue/amqp-ext": "*@dev",
Expand All @@ -20,6 +19,8 @@
"enqueue/simple-client": "*@dev",
"enqueue/test": "*@dev",
"enqueue/async-event-dispatcher": "*@dev",
"queue-interop/queue-interop": "^0.5@dev",
"queue-interop/queue-spec": "^0.5@dev",

"phpunit/phpunit": "^5",
"doctrine/doctrine-bundle": "~1.2",
Expand All @@ -40,10 +41,6 @@
"bin-dir": "bin"
},
"repositories": [
{
"type": "path",
"url": "pkg/psr-queue"
},
{
"type": "path",
"url": "pkg/test"
Expand Down
4 changes: 2 additions & 2 deletions docs/async_event_dispatcher/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher;

require_once __DIR__.'/vendor/autoload.php';

// it could be any other enqueue/psr-queue compatible context.
// it could be any other queue-interop/queue-interop compatible context.
$context = (new FsConnectionFactory('file://'.__DIR__.'/queues'))->createContext();
$eventQueue = $context->createQueue('symfony_events');

Expand Down Expand Up @@ -81,7 +81,7 @@ $dispatcher->dispatch('the_event', new GenericEvent('theSubject'));

// consume.php

use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

require_once __DIR__.'/vendor/autoload.php';
include __DIR__.'/config.php';
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle/async_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace AcmeBundle\Listener;

use Enqueue\Client\Message;
use Enqueue\Consumption\Result;
use Enqueue\Psr\PsrMessage;
use Interop\Queue\PsrMessage;
use Enqueue\Util\JSON;
use Symfony\Component\EventDispatcher\Event;
use Enqueue\AsyncEventDispatcher\EventTransformer;
Expand Down
18 changes: 9 additions & 9 deletions docs/bundle/job_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Guaranty that there is only single job running with such name.

```php
<?php
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrContext;
use Enqueue\Util\JSON;
use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
Expand Down Expand Up @@ -57,9 +57,9 @@ use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\Client\ProducerInterface;
use Enqueue\Util\JSON;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;

class Step1Processor implements PsrProcessor
{
Expand Down Expand Up @@ -140,9 +140,9 @@ use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\JobQueue\DependentJobService;
use Enqueue\Util\JSON;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;

class ReindexProcessor implements PsrProcessor
{
Expand Down
10 changes: 5 additions & 5 deletions docs/bundle/message_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ It is handy to subscribe on event messages. It allows to keep subscription login
namespace AppBundle\Async;

use Enqueue\Client\TopicSubscriberInterface;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

class SayHelloProcessor implements PsrProcessor, TopicSubscriberInterface
{
Expand All @@ -52,7 +52,7 @@ On the topic subscriber you can also define queue and processor name:
```php
<?php
use Enqueue\Client\TopicSubscriberInterface;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

class SayHelloProcessor implements PsrProcessor, TopicSubscriberInterface
{
Expand Down Expand Up @@ -89,7 +89,7 @@ If you send a message using ProducerV2::sendCommand('aCommandName') method it wi
namespace AppBundle\Async;

use Enqueue\Client\CommandSubscriberInterface;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
{
Expand All @@ -105,7 +105,7 @@ On the command subscriber you can also define additional settings such as queue
```php
<?php
use Enqueue\Client\CommandSubscriberInterface;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
{
Expand All @@ -124,7 +124,7 @@ In the container you can just add the tag `enqueue.client.message_processor` and
```php
<?php
use Enqueue\Client\CommandSubscriberInterface;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrProcessor;

class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
{
Expand Down
6 changes: 3 additions & 3 deletions docs/bundle/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ To consume messages you have to first create a message processor:

```php
<?php
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Enqueue\Client\TopicSubscriberInterface;

class FooProcessor implements PsrProcessor, TopicSubscriberInterface
Expand Down
4 changes: 2 additions & 2 deletions docs/client/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ $client->send('a_bar_topic', new class() implements \JsonSerializable {
```php
<?php

use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;

/** @var \Enqueue\SimpleClient\SimpleClient $client */

Expand Down
4 changes: 2 additions & 2 deletions docs/client/rpc_call.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Of course it is possible to implement rpc server side based on transport classes
```php
<?php

use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Enqueue\Consumption\Result;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\Extension\ReplyExtension;
Expand Down
30 changes: 15 additions & 15 deletions docs/consumption/message_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Here's example:

```php
<?php
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;

class SendMailProcessor implements PsrProcessor
{
Expand All @@ -26,9 +26,9 @@ Sometimes you have to reject messages explicitly.

```php
<?php
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Enqueue\Util\JSON;

class SendMailProcessor implements PsrProcessor
Expand All @@ -53,9 +53,9 @@ If it returns true than there was attempt to process message.

```php
<?php
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;

class SendMailProcessor implements PsrProcessor
{
Expand All @@ -76,9 +76,9 @@ The second argument is your context. You can use it to send messages to other qu

```php
<?php
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;

class SendMailProcessor implements PsrProcessor
{
Expand All @@ -99,9 +99,9 @@ The consumption component provide some useful extensions, for example there is a

```php
<?php
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\QueueConsumer;
use Enqueue\Consumption\Extension\ReplyExtension;
Expand Down
6 changes: 3 additions & 3 deletions docs/job_queue/run_sub_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ They will be executed in parallel.
```php
<?php
use Enqueue\Client\ProducerInterface;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\Util\JSON;
Expand Down
6 changes: 3 additions & 3 deletions docs/job_queue/run_unique_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ It shows how you can run unique job using job queue (The configuration is descri

```php
<?php
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Enqueue\JobQueue\JobRunner;

class UniqueJobProcessor implements PsrProcessor
Expand Down
6 changes: 3 additions & 3 deletions docs/magento/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ To consume messages you have to define a processor class first:
<?php
// app/code/local/Acme/Module/Helper/Async/Foo.php

use Enqueue\Psr\PsrContext;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrProcessor;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;

class Acme_Module_Helper_Async_Foo implements PsrProcessor
{
Expand Down
22 changes: 11 additions & 11 deletions docs/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Produce a message:

```php
<?php
use Enqueue\Psr\PsrConnectionFactory;
use Interop\Queue\PsrConnectionFactory;

/** @var PsrConnectionFactory $connectionFactory **/
$psrContext = $connectionFactory->createContext();
Expand All @@ -37,7 +37,7 @@ Consume a message:

```php
<?php
use Enqueue\Psr\PsrConnectionFactory;
use Interop\Queue\PsrConnectionFactory;

/** @var PsrConnectionFactory $connectionFactory **/
$psrContext = $connectionFactory->createContext();
Expand All @@ -64,9 +64,9 @@ The `consume` method starts the consumption process which last as long as it is

```php
<?php
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrProcessor;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrContext;
use Enqueue\Consumption\QueueConsumer;

/** @var PsrContext $psrContext */
Expand Down Expand Up @@ -132,8 +132,8 @@ It simplifies a server side of RPC.

```php
<?php
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\QueueConsumer;
use Enqueue\Consumption\Extension\ReplyExtension;
Expand Down Expand Up @@ -168,7 +168,7 @@ Here's an example of how you can send and consume event messages.
```php
<?php
use Enqueue\SimpleClient\SimpleClient;
use Enqueue\Psr\PsrMessage;
use Interop\Queue\PsrMessage;

// composer require enqueue/amqp-ext
$client = new SimpleClient('amqp://');
Expand All @@ -191,8 +191,8 @@ and command messages:
```php
<?php
use Enqueue\SimpleClient\SimpleClient;
use Enqueue\Psr\PsrMessage;
use Enqueue\Psr\PsrContext;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Enqueue\Client\Config;
use Enqueue\Consumption\Extension\ReplyExtension;
use Enqueue\Consumption\Result;
Expand Down Expand Up @@ -244,7 +244,7 @@ Let's see how you can use consumption one:
// app.php

use Symfony\Component\Console\Application;
use Enqueue\Psr\PsrMessage;
use Interop\Queue\PsrMessage;
use Enqueue\Consumption\QueueConsumer;
use Enqueue\Symfony\Consumption\ConsumeMessagesCommand;

Expand Down
Loading