diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-10-28 01:08:18 +0300 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-10-28 01:21:43 +0300 |
commit | 2d8a8a44432f3f302653525777f516325002266f (patch) | |
tree | 591e3a5f755d797bd7d0d83cdcc617bb6812a6a8 | |
parent | b9de0b9724090f6ebb81b7f6d1ec1697500a5ec8 (diff) |
Documentation: [B]Z[M]POP* doc blocks
-rw-r--r-- | redis.stub.php | 66 | ||||
-rw-r--r-- | redis_arginfo.h | 2 | ||||
-rw-r--r-- | redis_legacy_arginfo.h | 2 |
3 files changed, 68 insertions, 2 deletions
diff --git a/redis.stub.php b/redis.stub.php index 5d7bcc32..501cc1e5 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -278,12 +278,78 @@ class Redis { */ public function brpoplpush(string $src, string $dst, int|float $timeout): Redis|string|false; + /** + * POP the maximum scoring element off of one or more sorted sets, blocking up to a specified + * timeout if no elements are available. + * + * @see https://redis.io/commands/bzpopmax + * + * @param string|array $key_or_keys Either a string key or an array of one or more keys. + * @param string|int $timeout_or_key If the previous argument was an array, this argument + * must be a timeout value. Otherwise it could also be + * another key. + * @param mixed $extra_args Can consist of additional keys, until the last argument + * which needs to be a timeout. + * + * Following are examples of the two main ways to call this method. + * + * <code> + * // Method 1 - Variadic, with the last argument being our timeout + * $redis->bzPopMax('key1', 'key2', 'key3', 1.5); + * + * // Method 2 - A single array of keys, followed by the timeout + * $redis->bzPopMax(['key1', 'key2', 'key3'], 1.5); + * <?php> + * + * NOTE: We reccomend calling this function with an array and a timeout as the other strategy + * may be deprecated in future versions of PhpRedis + * ?> + */ public function bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): Redis|array|false; + /** + * POP the minimum scoring element off of one or more sorted sets, blocking up to a specified timeout + * if no elements are available + * + * This command is identical in semantics to bzPopMax so please see that method for more information. + * + * @see https://redis.io/commands/bzpopmin + * @see Redis::bzPopMax() + * + */ public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): Redis|array|false; + /** + * POP one or more elements from one or more sorted sets, blocking up to a specified amount of time + * when no elements are available. + * + * @param float $timeout How long to block if there are no element available + * @param array $keys The sorted sets to pop from + * @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you wish to + * pop the lowest or highest scoring members from the set(s). + * @param int $count Pop up to how many elements. + * + * @return Redis|array|null|false This function will return an array of popped elements, or false + * depending on whether any elements could be popped within the + * specified timeout. + * + * NOTE: If Redis::OPT_NULL_MULTIBULK_AS_NULL is set to true via Redis::setOption(), this method will + * instead return NULL when Redis doesn't pop any elements. + */ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false; + /** + * POP one or more of the highest or lowest scoring elements from one or more sorted sets. + * + * @see https://redis.io/commands/zmpop + * + * @param array $keys One or more sorted sets + * @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you want to + * pop the lowest or highest scoring elements. + * @param int $count Pop up to how many elements at once. + * + * @return Redis|array|null|false An array of popped elements or false if none could be popped. + */ public function zmpop(array $keys, string $from, int $count = 1): Redis|array|null|false; public function blmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false; diff --git a/redis_arginfo.h b/redis_arginfo.h index 30605343..d683a42a 100644 --- a/redis_arginfo.h +++ b/redis_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */ + * Stub hash: 76d56f0a612ec76a5e5f59c90fe09b223f846de6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null") diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index 89539d1d..d53dce66 100644 --- a/redis_legacy_arginfo.h +++ b/redis_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */ + * Stub hash: 76d56f0a612ec76a5e5f59c90fe09b223f846de6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) |