Skip to content

Commit

Permalink
Fixed docs. Removed prefix Psr
Browse files Browse the repository at this point in the history
  • Loading branch information
yurez committed Oct 31, 2018
1 parent dfc6768 commit e43a063
Show file tree
Hide file tree
Showing 31 changed files with 461 additions and 461 deletions.
8 changes: 4 additions & 4 deletions docs/async_event_dispatcher/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ $dispatcher->dispatch('the_event', new GenericEvent('theSubject'));

// consume.php

use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;

require_once __DIR__.'/vendor/autoload.php';
include __DIR__.'/config.php';
Expand All @@ -93,13 +93,13 @@ while (true) {
$result = $asyncProcessor->process($message, $context);

switch ((string) $result) {
case PsrProcessor::ACK:
case Processor::ACK:
$consumer->acknowledge($message);
break;
case PsrProcessor::REJECT:
case Processor::REJECT:
$consumer->reject($message);
break;
case PsrProcessor::REQUEUE:
case Processor::REQUEUE:
$consumer->reject($message, true);
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions docs/bundle/async_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace AcmeBundle\Listener;
use Enqueue\Client\Message;
use Enqueue\Consumption\Result;
use Interop\Queue\PsrMessage;
use Interop\Queue\Message as QueueMessage;
use Enqueue\Util\JSON;
use Symfony\Component\EventDispatcher\Event;
use Enqueue\AsyncEventDispatcher\EventTransformer;
Expand Down Expand Up @@ -132,7 +132,7 @@ class FooEventTransformer implements EventTransformer
/**
* {@inheritdoc}
*/
public function toEvent($eventName, PsrMessage $message)
public function toEvent($eventName, QueueMessage $message)
{
$data = JSON::decode($message->getBody());
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle/config_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enqueue:
# The broker DSN. These schemes are supported: "file", "amqp", "amqps", "db2", "ibm-db2", "mssql", "sqlsrv", "mysql", "mysql2", "pgsql", "postgres", "sqlite", "sqlite3", "null", "gearman", "beanstalk", "kafka", "rdkafka", "redis", "stomp", "sqs", "gps", "mongodb", to use these "file", "amqp", "amqps", "db2", "ibm-db2", "mssql", "sqlsrv", "mysql", "mysql2", "pgsql", "postgres", "sqlite", "sqlite3", "null", "gearman", "beanstalk", "kafka", "rdkafka", "redis", "stomp", "sqs", "gps", "mongodb" you have to install a package.
dsn: ~ # Required

# The connection factory class should implement "Interop\Queue\PsrConnectionFactory" interface
# The connection factory class should implement "Interop\Queue\ConnectionFactory" interface
connection_factory_class: ~

# The factory class should implement "Enqueue\ConnectionFactoryFactoryInterface" interface
Expand Down
34 changes: 17 additions & 17 deletions docs/bundle/job_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ Here's how to do it:
<?php
namespace App\Queue;

use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrContext;
use Interop\Queue\Message;
use Interop\Queue\Processor;
use Interop\Queue\Context;
use Enqueue\Util\JSON;
use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\Client\CommandSubscriberInterface;

class SearchReindexProcessor implements PsrProcessor, CommandSubscriberInterface
class SearchReindexProcessor implements Processor, CommandSubscriberInterface
{
private $jobRunner;

Expand All @@ -101,7 +101,7 @@ class SearchReindexProcessor implements PsrProcessor, CommandSubscriberInterface
$this->jobRunner = $jobRunner;
}

public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$data = JSON::decode($message->getBody());

Expand Down Expand Up @@ -160,11 +160,11 @@ use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\Client\ProducerInterface;
use Enqueue\Util\JSON;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Interop\Queue\Processor;

class Step1Processor implements PsrProcessor
class Step1Processor implements Processor
{
/**
* @var JobRunner
Expand All @@ -176,7 +176,7 @@ class Step1Processor implements PsrProcessor
*/
private $producer;

public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$data = JSON::decode($message->getBody());

Expand Down Expand Up @@ -207,14 +207,14 @@ class Step1Processor implements PsrProcessor
}
}

class Step2Processor implements PsrProcessor
class Step2Processor implements Processor
{
/**
* @var JobRunner
*/
private $jobRunner;

public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$data = JSON::decode($message->getBody());

Expand Down Expand Up @@ -244,11 +244,11 @@ use Enqueue\JobQueue\JobRunner;
use Enqueue\JobQueue\Job;
use Enqueue\JobQueue\DependentJobService;
use Enqueue\Util\JSON;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Interop\Queue\Processor;

class ReindexProcessor implements PsrProcessor
class ReindexProcessor implements Processor
{
/**
* @var JobRunner
Expand All @@ -260,7 +260,7 @@ class ReindexProcessor implements PsrProcessor
*/
private $dependentJob;

public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$data = JSON::decode($message->getBody());

Expand Down
20 changes: 10 additions & 10 deletions docs/bundle/message_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ It is handy to subscribe on event messages. It allows to keep subscription login
namespace AppBundle\Async;
use Enqueue\Client\TopicSubscriberInterface;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;
class SayHelloProcessor implements PsrProcessor, TopicSubscriberInterface
class SayHelloProcessor implements Processor, TopicSubscriberInterface
{
public static function getSubscribedTopics()
{
Expand All @@ -52,9 +52,9 @@ On the topic subscriber you can also define queue and processor name:
```php
<?php
use Enqueue\Client\TopicSubscriberInterface;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;
class SayHelloProcessor implements PsrProcessor, TopicSubscriberInterface
class SayHelloProcessor implements Processor, TopicSubscriberInterface
{
public static function getSubscribedTopics()
{
Expand Down Expand Up @@ -89,9 +89,9 @@ If you send a message using ProducerV2::sendCommand('aCommandName') method it wi
namespace AppBundle\Async;
use Enqueue\Client\CommandSubscriberInterface;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;
class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
class SayHelloProcessor implements Processor, CommandSubscriberInterface
{
public static function getSubscribedCommand()
{
Expand All @@ -105,9 +105,9 @@ On the command subscriber you can also define additional settings such as queue
```php
<?php
use Enqueue\Client\CommandSubscriberInterface;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;
class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
class SayHelloProcessor implements Processor, CommandSubscriberInterface
{
public static function getSubscribedCommand()
{
Expand All @@ -124,9 +124,9 @@ In the container you can just add the tag `enqueue.client.message_processor` and
```php
<?php
use Enqueue\Client\CommandSubscriberInterface;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Processor;
class SayHelloProcessor implements PsrProcessor, CommandSubscriberInterface
class SayHelloProcessor implements Processor, CommandSubscriberInterface
{
public static function getSubscribedCommand()
{
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle/message_producer.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Transport gives you the access to all transport specific features so you can tun

/** @var Symfony\Component\DependencyInjection\ContainerInterface $container */

/** @var Interop\Queue\PsrContext $context */
/** @var Interop\Queue\Context $context */
$context = $container->get('enqueue.transport.context');

$context->createProducer()->send(
Expand Down
10 changes: 5 additions & 5 deletions docs/bundle/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ To consume messages you have to first create a message processor:

```php
<?php
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Interop\Queue\Processor;
use Enqueue\Client\TopicSubscriberInterface;

class FooProcessor implements PsrProcessor, TopicSubscriberInterface
class FooProcessor implements Processor, TopicSubscriberInterface
{
public function process(PsrMessage $message, PsrContext $session)
public function process(Message $message, Context $session)
{
echo $message->getBody();

Expand Down
8 changes: 4 additions & 4 deletions docs/client/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ $replyMessage->getBody();
```php
<?php

use Interop\Queue\PsrMessage;
use Interop\Queue\PsrProcessor;
use Interop\Queue\Message;
use Interop\Queue\Processor;

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

$client->bindTopic('a_bar_topic', function(PsrMessage $psrMessage) {
$client->bindTopic('a_bar_topic', function(Message $psrMessage) {
// processing logic here

return PsrProcessor::ACK;
return Processor::ACK;
});

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

use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Enqueue\Consumption\Result;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\Extension\ReplyExtension;
use Enqueue\SimpleClient\SimpleClient;

/** @var \Interop\Queue\PsrContext $context */
/** @var \Interop\Queue\Context $context */

// composer require enqueue/amqp-ext # or enqueue/amqp-bunny, enqueue/amqp-lib
$client = new SimpleClient('amqp:');

$client->bindCommand('square', function (PsrMessage $message, PsrContext $context) use (&$requestMessage) {
$client->bindCommand('square', function (Message $message, Context $context) use (&$requestMessage) {
$number = (int) $message->getBody();

return Result::reply($context->createMessage($number ^ 2));
Expand Down
54 changes: 27 additions & 27 deletions docs/consumption/message_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Here's example:

```php
<?php
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Processor;
use Interop\Queue\Message;
use Interop\Queue\Context;

class SendMailProcessor implements PsrProcessor
class SendMailProcessor implements Processor
{
public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$this->mailer->send('[email protected]', $message->getBody());

Expand All @@ -40,14 +40,14 @@ Look at the next example that shows the message validation before sending a mail

```php
<?php
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Processor;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Enqueue\Util\JSON;

class SendMailProcessor implements PsrProcessor
class SendMailProcessor implements Processor
{
public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$data = JSON::decode($message->getBody());
if ($user = $this->userRepository->find($data['userId'])) {
Expand All @@ -67,13 +67,13 @@ If it returns true than there was attempt to process message.

```php
<?php
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Processor;
use Interop\Queue\Message;
use Interop\Queue\Context;

class SendMailProcessor implements PsrProcessor
class SendMailProcessor implements Processor
{
public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
if ($message->isRedelivered()) {
return self::REQUEUE;
Expand All @@ -90,13 +90,13 @@ The second argument is your context. You can use it to send messages to other qu

```php
<?php
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Processor;
use Interop\Queue\Message;
use Interop\Queue\Context;

class SendMailProcessor implements PsrProcessor
class SendMailProcessor implements Processor
{
public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$this->mailer->send('[email protected]', $message->getBody());

Expand All @@ -117,17 +117,17 @@ Don't forget to add `ReplyExtension`.

```php
<?php
use Interop\Queue\PsrProcessor;
use Interop\Queue\PsrMessage;
use Interop\Queue\PsrContext;
use Interop\Queue\Processor;
use Interop\Queue\Message;
use Interop\Queue\Context;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\QueueConsumer;
use Enqueue\Consumption\Extension\ReplyExtension;
use Enqueue\Consumption\Result;

class SendMailProcessor implements PsrProcessor
class SendMailProcessor implements Processor
{
public function process(PsrMessage $message, PsrContext $context)
public function process(Message $message, Context $context)
{
$this->mailer->send('[email protected]', $message->getBody());

Expand All @@ -137,9 +137,9 @@ class SendMailProcessor implements PsrProcessor
}
}

/** @var \Interop\Queue\PsrContext $psrContext */
/** @var \Interop\Queue\Context $context */

$queueConsumer = new QueueConsumer($psrContext, new ChainExtension([
$queueConsumer = new QueueConsumer($context, new ChainExtension([
new ReplyExtension()
]));

Expand Down
Loading

0 comments on commit e43a063

Please sign in to comment.