Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d8a8a4

Browse files
Documentation: [B]Z[M]POP* doc blocks
1 parent b9de0b9 commit 2d8a8a4

3 files changed

Lines changed: 68 additions & 2 deletions

File tree

redis.stub.php

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,78 @@ public function brPop(string|array $key_or_keys, string|float|int $timeout_or_ke
278278
*/
279279
public function brpoplpush(string $src, string $dst, int|float $timeout): Redis|string|false;
280280

281+
/**
282+
* POP the maximum scoring element off of one or more sorted sets, blocking up to a specified
283+
* timeout if no elements are available.
284+
*
285+
* @see https://redis.io/commands/bzpopmax
286+
*
287+
* @param string|array $key_or_keys Either a string key or an array of one or more keys.
288+
* @param string|int $timeout_or_key If the previous argument was an array, this argument
289+
* must be a timeout value. Otherwise it could also be
290+
* another key.
291+
* @param mixed $extra_args Can consist of additional keys, until the last argument
292+
* which needs to be a timeout.
293+
*
294+
* Following are examples of the two main ways to call this method.
295+
*
296+
* <code>
297+
* // Method 1 - Variadic, with the last argument being our timeout
298+
* $redis->bzPopMax('key1', 'key2', 'key3', 1.5);
299+
*
300+
* // Method 2 - A single array of keys, followed by the timeout
301+
* $redis->bzPopMax(['key1', 'key2', 'key3'], 1.5);
302+
* <?php>
303+
*
304+
* NOTE: We reccomend calling this function with an array and a timeout as the other strategy
305+
* may be deprecated in future versions of PhpRedis
306+
* ?>
307+
*/
281308
public function bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): Redis|array|false;
282309

310+
/**
311+
* POP the minimum scoring element off of one or more sorted sets, blocking up to a specified timeout
312+
* if no elements are available
313+
*
314+
* This command is identical in semantics to bzPopMax so please see that method for more information.
315+
*
316+
* @see https://redis.io/commands/bzpopmin
317+
* @see Redis::bzPopMax()
318+
*
319+
*/
283320
public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): Redis|array|false;
284321

322+
/**
323+
* POP one or more elements from one or more sorted sets, blocking up to a specified amount of time
324+
* when no elements are available.
325+
*
326+
* @param float $timeout How long to block if there are no element available
327+
* @param array $keys The sorted sets to pop from
328+
* @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you wish to
329+
* pop the lowest or highest scoring members from the set(s).
330+
* @param int $count Pop up to how many elements.
331+
*
332+
* @return Redis|array|null|false This function will return an array of popped elements, or false
333+
* depending on whether any elements could be popped within the
334+
* specified timeout.
335+
*
336+
* NOTE: If Redis::OPT_NULL_MULTIBULK_AS_NULL is set to true via Redis::setOption(), this method will
337+
* instead return NULL when Redis doesn't pop any elements.
338+
*/
285339
public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false;
286340

341+
/**
342+
* POP one or more of the highest or lowest scoring elements from one or more sorted sets.
343+
*
344+
* @see https://redis.io/commands/zmpop
345+
*
346+
* @param array $keys One or more sorted sets
347+
* @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you want to
348+
* pop the lowest or highest scoring elements.
349+
* @param int $count Pop up to how many elements at once.
350+
*
351+
* @return Redis|array|null|false An array of popped elements or false if none could be popped.
352+
*/
287353
public function zmpop(array $keys, string $from, int $count = 1): Redis|array|null|false;
288354

289355
public function blmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false;

redis_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */
2+
* Stub hash: 76d56f0a612ec76a5e5f59c90fe09b223f846de6 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null")

redis_legacy_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */
2+
* Stub hash: 76d56f0a612ec76a5e5f59c90fe09b223f846de6 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_INFO(0, options)

0 commit comments

Comments
 (0)