-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from php-enqueue/client-fix-command-routing
Client fix command routing
- Loading branch information
Showing
6 changed files
with
102 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ services: | |
arguments: | ||
- '@enqueue.client.driver' | ||
- [] | ||
- [] | ||
tags: | ||
- | ||
name: 'enqueue.client.processor' | ||
|
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
30 changes: 30 additions & 0 deletions
30
pkg/enqueue-bundle/Tests/Functional/TestCommandProcessor.php
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Enqueue\Bundle\Tests\Functional; | ||
|
||
use Enqueue\Client\CommandSubscriberInterface; | ||
use Interop\Queue\PsrContext; | ||
use Interop\Queue\PsrMessage; | ||
use Interop\Queue\PsrProcessor; | ||
|
||
class TestCommandProcessor implements PsrProcessor, CommandSubscriberInterface | ||
{ | ||
const COMMAND = 'test-command'; | ||
|
||
/** | ||
* @var PsrMessage | ||
*/ | ||
public $message; | ||
|
||
public function process(PsrMessage $message, PsrContext $context) | ||
{ | ||
$this->message = $message; | ||
|
||
return self::ACK; | ||
} | ||
|
||
public static function getSubscribedCommand() | ||
{ | ||
return self::COMMAND; | ||
} | ||
} |
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