Skip to content
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
4 changes: 2 additions & 2 deletions src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Yiisoft\Db\Query\Query;
use Yiisoft\Mutex\MutexFactoryInterface;
use Yiisoft\Mutex\MutexInterface;
use Yiisoft\Queue\Provider\QueueProviderInterface;
use Yiisoft\Queue\DefaultQueue;
use Exception;

use function is_array;
Expand Down Expand Up @@ -56,7 +56,7 @@ public function __construct(
private MessageSerializerInterface $serializer,
private LoopInterface $loop,
private MutexFactoryInterface $mutexFactory,
private string $channel = QueueProviderInterface::DEFAULT_QUEUE,
private string $channel = DefaultQueue::NAME,
) {
$this->mutex = $this->mutexFactory->create(self::class . $this->channel);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Yiisoft\Queue\Message\GenericMessage;
use Yiisoft\Queue\Message\IdEnvelope;
use Yiisoft\Queue\Message\Serializer\MessageSerializerInterface;
use Yiisoft\Queue\Provider\QueueProviderInterface;
use Yiisoft\Queue\DefaultQueue;

use function in_array;

Expand Down Expand Up @@ -49,7 +49,7 @@ public function testPushUsesMessageMetaAndReturnsIdEnvelope(): void
->expects(self::once())
->method('insert')
->with('{{%queue}}', self::callback(static function (array $row): bool {
return $row['channel'] === QueueProviderInterface::DEFAULT_QUEUE
return $row['channel'] === DefaultQueue::NAME
&& $row['job'] === 'serialized-message'
&& $row['ttr'] === 10
&& $row['delay'] === 5.0
Expand Down Expand Up @@ -93,7 +93,7 @@ public function testWithChannelClonesAdapterAndUsesNewChannelMutex(): void
->method('create')
->with(self::callback(static function (string $name) use (&$mutexNames): bool {
$mutexNames[] = $name;
return in_array($name, [Adapter::class . QueueProviderInterface::DEFAULT_QUEUE, Adapter::class . 'mail'], true);
return in_array($name, [Adapter::class . DefaultQueue::NAME, Adapter::class . 'mail'], true);
}))
->willReturn($this->createMock(MutexInterface::class));

Expand All @@ -104,7 +104,7 @@ public function testWithChannelClonesAdapterAndUsesNewChannelMutex(): void
$new = $adapter->withChannel('mail');

self::assertNotSame($adapter, $new);
self::assertSame([Adapter::class . QueueProviderInterface::DEFAULT_QUEUE, Adapter::class . 'mail'], $mutexNames);
self::assertSame([Adapter::class . DefaultQueue::NAME, Adapter::class . 'mail'], $mutexNames);
}

private function createAdapter(
Expand Down
Loading