-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathQueueProviderInterface.php
More file actions
47 lines (40 loc) · 1.2 KB
/
QueueProviderInterface.php
File metadata and controls
47 lines (40 loc) · 1.2 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
39
40
41
42
43
44
45
46
47
<?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 name.
*/
interface QueueProviderInterface
{
/** @psalm-suppress MissingClassConstType */
public const DEFAULT_QUEUE = 'yii-queue';
/**
* Finds a queue by name and returns it.
*
* @param BackedEnum|string $name Queue name.
*
* @throws InvalidQueueConfigException If the queue configuration is invalid.
* @throws QueueNotFoundException If the queue is not found.
* @throws QueueProviderException If the queue provider fails to provide a queue.
* @return QueueInterface Queue instance.
*/
public function get(string|BackedEnum $name): QueueInterface;
/**
* Check if a queue with the specified name exists.
*
* @param BackedEnum|string $name Queue name.
*
* @return bool Whether the queue exists.
*/
public function has(string|BackedEnum $name): bool;
/**
* Returns a list of queue names.
*
* @return string[] Queue names.
*
* @psalm-return list<string>
*/
public function getNames(): array;
}