-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathQueue.php
More file actions
122 lines (107 loc) · 2.83 KB
/
Copy pathQueue.php
File metadata and controls
122 lines (107 loc) · 2.83 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
declare(strict_types=1);
/**
* This file is part of CodeIgniter Queue.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Config;
use CodeIgniter\Queue\Config\Queue as BaseQueue;
use CodeIgniter\Queue\Handlers\DatabaseHandler;
use CodeIgniter\Queue\Handlers\PredisHandler;
use CodeIgniter\Queue\Handlers\RabbitMQHandler;
use CodeIgniter\Queue\Handlers\RedisHandler;
use Tests\Support\Jobs\ConstructorError;
use Tests\Support\Jobs\Failure;
use Tests\Support\Jobs\ProcessTypeError;
use Tests\Support\Jobs\Success;
class Queue extends BaseQueue
{
/**
* Default handler.
*/
public string $defaultHandler = 'database';
/**
* Available handlers.
*/
public array $handlers = [
'database' => DatabaseHandler::class,
'redis' => RedisHandler::class,
'predis' => PredisHandler::class,
'rabbitmq' => RabbitMQHandler::class,
];
/**
* Database handler config.
*/
public array $database = [
'dbGroup' => 'default',
'getShared' => true,
'skipLocked' => true,
];
/**
* Redis and Predis handler config.
*/
public array $redis = [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'timeout' => 0,
'database' => 0,
];
/**
* Predis handler config.
*/
public array $predis = [
'scheme' => 'tcp',
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'timeout' => 5,
'database' => 0,
'prefix' => '',
];
/**
* RabbitMQ handler config.
*/
public array $rabbitmq = [
'host' => '127.0.0.1',
'port' => 5672,
'user' => 'guest',
'password' => 'guest',
'vhost' => '/',
];
/**
* Whether to keep the DONE jobs in the queue.
*/
public bool $keepDoneJobs = false;
/**
* Whether to save failed jobs for later review.
*/
public bool $keepFailedJobs = true;
/**
* Default priorities for the queue
* if different from the "default".
*/
public array $queueDefaultPriority = [
'queue' => 'low',
];
/**
* Valid priorities for the queue,
* if different from the "default".
*/
public array $queuePriorities = [
'queue' => ['high', 'low'],
];
/**
* Your jobs handlers.
*/
public array $jobHandlers = [
'success' => Success::class,
'failure' => Failure::class,
'constructor-runtime-error' => ConstructorError::class,
'process-type-error' => ProcessTypeError::class,
];
}