diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-10-26 21:54:54 +0300 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-10-26 22:40:14 +0300 |
commit | c4de86672b58fa02c71a664a661a36e70b95c2d4 (patch) | |
tree | aaa4d538bddb0a0c91339ce9974495b692994fce | |
parent | 1d6c52ee395884eae69847242bcd04598553f397 (diff) |
Documentation: Redis constructor
-rw-r--r-- | redis.stub.php | 58 | ||||
-rw-r--r-- | redis_arginfo.h | 2 | ||||
-rw-r--r-- | redis_legacy_arginfo.h | 2 |
3 files changed, 60 insertions, 2 deletions
diff --git a/redis.stub.php b/redis.stub.php index 6f30e337..6b840127 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -8,6 +8,64 @@ class Redis { + /** + * Create a new Redis instance. If passed sufficient information in the + * options array it is also possible to connect to an instance at the same + * time. + * + * @see Redis::connect() + * @see https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ + * + * Following is an example of an options array with the supported + * configuration values. Note that all of these values are optional, and you + * can instead connect to Redis via PhpRedis' connect() method. + * + * <code> + * <?php + * $options = [ + * 'host' => 'localhost', + * 'port' => 6379, + * 'readTimeout' => 2.5, + * 'connectTimeout' => 2.5, + * 'persistent' => true, + * + * // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass'] + * 'auth' => ['phpredis', 'phpredis'], + * + * // See PHP stream options for valid SSL configuration settings. + * 'ssl' => ['verify_peer' => false], + * + * // How quickly to retry a connection after we time out or it closes. + * // Note that this setting is overridden by 'backoff' strategies. + * 'retryInterval' => 100, + * + * // Which backoff algorithm to use. 'decorrelated jitter' is + * // likely the best one for most solutiona, but there are many + * // to choose from: + * // REDIS_BACKOFF_ALGORITHM_DEFAULT + * // REDIS_BACKOFF_ALGORITHM_CONSTANT + * // REDIS_BACKOFF_ALGORITHM_UNIFORM + * // REDIS_BACKOFF_ALGORITHM_EXPONENTIAL + * // REDIS_BACKOFF_ALGORITHM_FULL_JITTER + * // REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER + * // REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER + * // + * // 'base', and 'cap' are in milliseconds and represent the first + * // delay redis will use when reconnecting, and the maximum delay + * // we will reach while retrying. + * 'backoff' => [ + * 'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER, + * 'base' => 500, + * 'cap' => 750, + * ] + * ]; + * ?> + * </code> + * + * Note: If you do wish to connect via the constructor, only 'host' is + * strictly required, which will cause PhpRedis to connect to that + * host on Redis' default port (6379). + */ public function __construct(array $options = null); public function __destruct(); diff --git a/redis_arginfo.h b/redis_arginfo.h index fa162b8f..3686df9e 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: 7c2ec068711e216a4308a2c405c32204edf60d23 */ + * Stub hash: 758f508fa69bda30d2af32ce83d19b5645f16263 */ 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 4cd44ad0..f5b08015 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: 7c2ec068711e216a4308a2c405c32204edf60d23 */ + * Stub hash: 758f508fa69bda30d2af32ce83d19b5645f16263 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) |