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

Skip to content

Commit c4de866

Browse files
Documentation: Redis constructor
1 parent 1d6c52e commit c4de866

3 files changed

Lines changed: 60 additions & 2 deletions

File tree

redis.stub.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,64 @@
88

99
class Redis {
1010

11+
/**
12+
* Create a new Redis instance. If passed sufficient information in the
13+
* options array it is also possible to connect to an instance at the same
14+
* time.
15+
*
16+
* @see Redis::connect()
17+
* @see https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
18+
*
19+
* Following is an example of an options array with the supported
20+
* configuration values. Note that all of these values are optional, and you
21+
* can instead connect to Redis via PhpRedis' connect() method.
22+
*
23+
* <code>
24+
* <?php
25+
* $options = [
26+
* 'host' => 'localhost',
27+
* 'port' => 6379,
28+
* 'readTimeout' => 2.5,
29+
* 'connectTimeout' => 2.5,
30+
* 'persistent' => true,
31+
*
32+
* // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass']
33+
* 'auth' => ['phpredis', 'phpredis'],
34+
*
35+
* // See PHP stream options for valid SSL configuration settings.
36+
* 'ssl' => ['verify_peer' => false],
37+
*
38+
* // How quickly to retry a connection after we time out or it closes.
39+
* // Note that this setting is overridden by 'backoff' strategies.
40+
* 'retryInterval' => 100,
41+
*
42+
* // Which backoff algorithm to use. 'decorrelated jitter' is
43+
* // likely the best one for most solutiona, but there are many
44+
* // to choose from:
45+
* // REDIS_BACKOFF_ALGORITHM_DEFAULT
46+
* // REDIS_BACKOFF_ALGORITHM_CONSTANT
47+
* // REDIS_BACKOFF_ALGORITHM_UNIFORM
48+
* // REDIS_BACKOFF_ALGORITHM_EXPONENTIAL
49+
* // REDIS_BACKOFF_ALGORITHM_FULL_JITTER
50+
* // REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER
51+
* // REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER
52+
* //
53+
* // 'base', and 'cap' are in milliseconds and represent the first
54+
* // delay redis will use when reconnecting, and the maximum delay
55+
* // we will reach while retrying.
56+
* 'backoff' => [
57+
* 'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER,
58+
* 'base' => 500,
59+
* 'cap' => 750,
60+
* ]
61+
* ];
62+
* ?>
63+
* </code>
64+
*
65+
* Note: If you do wish to connect via the constructor, only 'host' is
66+
* strictly required, which will cause PhpRedis to connect to that
67+
* host on Redis' default port (6379).
68+
*/
1169
public function __construct(array $options = null);
1270

1371
public function __destruct();

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: 7c2ec068711e216a4308a2c405c32204edf60d23 */
2+
* Stub hash: 758f508fa69bda30d2af32ce83d19b5645f16263 */
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: 7c2ec068711e216a4308a2c405c32204edf60d23 */
2+
* Stub hash: 758f508fa69bda30d2af32ce83d19b5645f16263 */
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)