Skip to content

Commit a897d8e

Browse files
committed
redid
1 parent 37950de commit a897d8e

7 files changed

+106
-193
lines changed

pkg/redis/LuaScripts.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ class LuaScripts
1111
* KEYS[2] - The reserved queue we are moving message to
1212
* ARGV[1] - Now timestamp
1313
* ARGV[2] - Redelivery at timestamp
14+
*
15+
* @return string
1416
*/
15-
public static function receiveMessage()
17+
public static function receiveMessage(): string
1618
{
17-
return <<<LUA
19+
return <<<'LUA'
1820
local message = redis.call('RPOP', KEYS[1])
1921
2022
if (not message) then
@@ -56,7 +58,7 @@ public static function receiveMessage()
5658
*
5759
* @return string
5860
*/
59-
public static function migrateExpired()
61+
public static function migrateExpired(): string
6062
{
6163
return <<<'LUA'
6264
-- Get all of the messages with an expired "score"...

pkg/redis/RedisConsumerHelperTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
trait RedisConsumerHelperTrait
88
{
9-
protected function pushQueueNameBack(array &$queueNames, string $queueName): void
9+
protected function pushQueueNameBack(array &$queueNames, string $queueName): void
1010
{
1111
if (count($queueNames) <= 1) {
1212
return;

pkg/redis/RedisNonBlockingConsumeStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(RedisContext $context)
3232
*/
3333
public function receiveMessage(array $queues, int $timeout, int $redeliveryDelay): ?RedisMessage
3434
{
35-
$endAt = microtime(true) + $timeout/1000;
35+
$endAt = microtime(true) + $timeout / 1000;
3636

3737
if (null === $this->queueNames) {
3838
$this->queueNames = [];

pkg/redis/Tests/RedisConnectionFactoryConfigTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public static function provideConfigs()
9191
'predis_options' => null,
9292
'ssl' => null,
9393
'redelivery_delay' => 300,
94+
'consume_strategy' => 'blocking',
9495
],
9596
];
9697

@@ -112,6 +113,7 @@ public static function provideConfigs()
112113
'predis_options' => null,
113114
'ssl' => null,
114115
'redelivery_delay' => 300,
116+
'consume_strategy' => 'blocking',
115117
],
116118
];
117119

@@ -133,6 +135,7 @@ public static function provideConfigs()
133135
'predis_options' => null,
134136
'ssl' => null,
135137
'redelivery_delay' => 300,
138+
'consume_strategy' => 'blocking',
136139
],
137140
];
138141

@@ -155,6 +158,7 @@ public static function provideConfigs()
155158
'ssl' => null,
156159
'foo' => 'bar',
157160
'redelivery_delay' => 300,
161+
'consume_strategy' => 'blocking',
158162
],
159163
];
160164

@@ -177,6 +181,7 @@ public static function provideConfigs()
177181
'ssl' => null,
178182
'foo' => 'bar',
179183
'redelivery_delay' => 300,
184+
'consume_strategy' => 'blocking',
180185
],
181186
];
182187

@@ -199,6 +204,7 @@ public static function provideConfigs()
199204
'ssl' => null,
200205
'foo' => 'bar',
201206
'redelivery_delay' => 300,
207+
'consume_strategy' => 'blocking',
202208
],
203209
];
204210

@@ -222,6 +228,7 @@ public static function provideConfigs()
222228
'ssl' => null,
223229
'foo' => 'bar',
224230
'redelivery_delay' => 300,
231+
'consume_strategy' => 'blocking',
225232
],
226233
];
227234

@@ -245,6 +252,7 @@ public static function provideConfigs()
245252
'ssl' => null,
246253
'foo' => 'bar',
247254
'redelivery_delay' => 300,
255+
'consume_strategy' => 'blocking',
248256
],
249257
];
250258

@@ -268,6 +276,7 @@ public static function provideConfigs()
268276
'ssl' => null,
269277
'foo' => 'bar',
270278
'redelivery_delay' => 300,
279+
'consume_strategy' => 'blocking',
271280
],
272281
];
273282

@@ -290,6 +299,7 @@ public static function provideConfigs()
290299
'ssl' => null,
291300
'foo' => 'bar',
292301
'redelivery_delay' => 300,
302+
'consume_strategy' => 'blocking',
293303
],
294304
];
295305

@@ -312,6 +322,7 @@ public static function provideConfigs()
312322
'predis_options' => null,
313323
'ssl' => null,
314324
'redelivery_delay' => 300,
325+
'consume_strategy' => 'blocking',
315326
],
316327
];
317328

@@ -334,6 +345,7 @@ public static function provideConfigs()
334345
'predis_options' => null,
335346
'ssl' => null,
336347
'redelivery_delay' => 300,
348+
'consume_strategy' => 'blocking',
337349
],
338350
];
339351

@@ -356,6 +368,7 @@ public static function provideConfigs()
356368
'predis_options' => null,
357369
'ssl' => null,
358370
'redelivery_delay' => 300,
371+
'consume_strategy' => 'blocking',
359372
],
360373
];
361374

@@ -382,6 +395,7 @@ public static function provideConfigs()
382395
'verify_peer' => '1',
383396
],
384397
'redelivery_delay' => 300,
398+
'consume_strategy' => 'blocking',
385399
],
386400
];
387401
}

0 commit comments

Comments
 (0)