forked from php-enqueue/enqueue-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
461 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()); | ||
|
||
|
@@ -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'])) { | ||
|
@@ -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; | ||
|
@@ -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()); | ||
|
||
|
@@ -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()); | ||
|
||
|
@@ -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() | ||
])); | ||
|
||
|
Oops, something went wrong.