-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathQueueProviderInterface.php
More file actions
38 lines (32 loc) · 1.06 KB
/
Copy pathQueueProviderInterface.php
File metadata and controls
38 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
namespace Yiisoft\Queue\Provider;
use BackedEnum;
use Yiisoft\Queue\QueueInterface;
/**
* `QueueProviderInterface` provides a way to get a queue instance by channel name.
*/
interface QueueProviderInterface
{
/** @psalm-suppress MissingClassConstType */
public const DEFAULT_CHANNEL = 'yii-queue';
/**
* Find a queue by channel name and returns it.
*
* @param BackedEnum|string $channel Channel name.
*
* @throws InvalidQueueConfigException If the queue configuration is invalid.
* @throws ChannelNotFoundException If the channel is not found.
* @throws QueueProviderException If the queue provider fails to provide a queue.
* @return QueueInterface Queue instance.
*/
public function get(string|BackedEnum $channel): QueueInterface;
/**
* Check if a queue with the specified channel name exists.
*
* @param BackedEnum|string $channel Channel name.
*
* @return bool Whether the queue exists.
*/
public function has(string|BackedEnum $channel): bool;
}