-
Notifications
You must be signed in to change notification settings - Fork 437
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 #152 from php-enqueue/delay_strategy
[amqp] Delay Strategy
- Loading branch information
Showing
28 changed files
with
1,048 additions
and
46 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
37 changes: 37 additions & 0 deletions
37
pkg/amqp-bunny/Tests/Spec/AmqpSendAndReceiveDelayedMessageWithDelayPluginStrategyTest.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,37 @@ | ||
<?php | ||
|
||
namespace Enqueue\AmqpBunny\Tests\Spec; | ||
|
||
use Enqueue\AmqpLib\AmqpConnectionFactory; | ||
use Enqueue\AmqpTools\RabbitMqDelayPluginDelayStrategy; | ||
use Interop\Queue\PsrContext; | ||
use Interop\Queue\Spec\SendAndReceiveDelayedMessageFromQueueSpec; | ||
|
||
/** | ||
* @group functional | ||
*/ | ||
class AmqpSendAndReceiveDelayedMessageWithDelayPluginStrategyTest extends SendAndReceiveDelayedMessageFromQueueSpec | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function createContext() | ||
{ | ||
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN')); | ||
$factory->setDelayStrategy(new RabbitMqDelayPluginDelayStrategy()); | ||
|
||
return $factory->createContext(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function createQueue(PsrContext $context, $queueName) | ||
{ | ||
$queue = parent::createQueue($context, $queueName); | ||
|
||
$context->declareQueue($queue); | ||
|
||
return $queue; | ||
} | ||
} |
Oops, something went wrong.