File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010use Yiisoft \Queue \Debug \QueueProviderInterfaceProxy ;
1111use Yiisoft \Queue \Debug \QueueWorkerInterfaceProxy ;
1212use Yiisoft \Queue \Provider \QueueProviderInterface ;
13- use Yiisoft \Queue \QueueInterface ;
1413use Yiisoft \Queue \Worker \WorkerInterface ;
1514
1615return [
2423 'yiisoft/queue ' => [
2524 'handlers ' => [],
2625 'channels ' => [
27- QueueInterface ::DEFAULT_CHANNEL => AdapterInterface::class,
26+ QueueProviderInterface ::DEFAULT_CHANNEL => AdapterInterface::class,
2827 ],
2928 'middlewares-push ' => [],
3029 'middlewares-consume ' => [],
Original file line number Diff line number Diff line change 99use Yiisoft \Queue \ChannelNormalizer ;
1010use Yiisoft \Queue \JobStatus ;
1111use Yiisoft \Queue \Message \MessageInterface ;
12+ use Yiisoft \Queue \Provider \QueueProviderInterface ;
1213use Yiisoft \Queue \QueueInterface ;
1314use Yiisoft \Queue \Worker \WorkerInterface ;
1415use Yiisoft \Queue \Message \IdEnvelope ;
@@ -22,7 +23,7 @@ final class SynchronousAdapter implements AdapterInterface
2223 public function __construct (
2324 private readonly WorkerInterface $ worker ,
2425 private readonly QueueInterface $ queue ,
25- string |BackedEnum $ channel = QueueInterface ::DEFAULT_CHANNEL ,
26+ string |BackedEnum $ channel = QueueProviderInterface ::DEFAULT_CHANNEL ,
2627 ) {
2728 $ this ->channel = ChannelNormalizer::normalize ($ channel );
2829 }
Original file line number Diff line number Diff line change 1010use Symfony \Component \Console \Input \InputInterface ;
1111use Symfony \Component \Console \Output \OutputInterface ;
1212use Yiisoft \Queue \Provider \QueueProviderInterface ;
13- use Yiisoft \Queue \QueueInterface ;
1413
1514#[AsCommand(
1615 'queue:listen ' ,
@@ -30,7 +29,7 @@ public function configure(): void
3029 'channel ' ,
3130 InputArgument::OPTIONAL ,
3231 'Queue channel name to connect to ' ,
33- QueueInterface ::DEFAULT_CHANNEL ,
32+ QueueProviderInterface ::DEFAULT_CHANNEL ,
3433 );
3534 }
3635
Original file line number Diff line number Diff line change 1212 */
1313interface QueueProviderInterface
1414{
15+ /** @psalm-suppress MissingClassConstType */
16+ public const DEFAULT_CHANNEL = 'yii-queue ' ;
17+
1518 /**
1619 * Find a queue by channel name and returns it.
1720 *
Original file line number Diff line number Diff line change 1111
1212interface QueueInterface
1313{
14- /** @psalm-suppress MissingClassConstType */
15- public const DEFAULT_CHANNEL = 'yii-queue ' ;
16-
1714 /**
1815 * Pushes a message into the queue.
1916 *
Original file line number Diff line number Diff line change 99use Yiisoft \Queue \ChannelNormalizer ;
1010use Yiisoft \Queue \JobStatus ;
1111use Yiisoft \Queue \Message \MessageInterface ;
12- use Yiisoft \Queue \QueueInterface ;
12+ use Yiisoft \Queue \Provider \ QueueProviderInterface ;
1313
1414/**
1515 * Stub adapter that does nothing. Job status is always "done".
@@ -19,7 +19,7 @@ final class StubAdapter implements AdapterInterface
1919 private string $ channel ;
2020
2121 public function __construct (
22- string |BackedEnum $ channel = QueueInterface ::DEFAULT_CHANNEL
22+ string |BackedEnum $ channel = QueueProviderInterface ::DEFAULT_CHANNEL
2323 ) {
2424 $ this ->channel = ChannelNormalizer::normalize ($ channel );
2525 }
Original file line number Diff line number Diff line change 1010use Yiisoft \Queue \JobStatus ;
1111use Yiisoft \Queue \Message \IdEnvelope ;
1212use Yiisoft \Queue \Message \Message ;
13- use Yiisoft \Queue \QueueInterface ;
13+ use Yiisoft \Queue \Provider \ QueueProviderInterface ;
1414use Yiisoft \Queue \Stubs \StubQueue ;
1515use Yiisoft \Queue \Stubs \StubWorker ;
1616use Yiisoft \Queue \Tests \TestCase ;
@@ -58,7 +58,7 @@ public function testIdSetting(): void
5858 public function testWithSameChannel (): void
5959 {
6060 $ adapter = $ this ->getAdapter ();
61- self ::assertEquals ($ adapter , $ adapter ->withChannel (QueueInterface ::DEFAULT_CHANNEL ));
61+ self ::assertEquals ($ adapter , $ adapter ->withChannel (QueueProviderInterface ::DEFAULT_CHANNEL ));
6262 }
6363
6464 public function testWithAnotherChannel (): void
You can’t perform that action at this time.
0 commit comments