Skip to content

Commit 9ec0c93

Browse files
committed
Update arrays.markdown
Documentation with example for great addition of connetion timeout 'connect_timeout'
1 parent 4c1f1bc commit 9ec0c93

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

arrays.markdown

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@ $ra = new RedisArray(array("host1", "host2", "host3"), array("previous" => array
4040
#### Specifying the "retry_interval" parameter
4141
The retry_interval is used to specify a delay in milliseconds between reconnection attempts in case the client loses connection with a server
4242
<pre>
43-
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("retry_timeout" => 100)));
43+
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("retry_timeout" => 100));
4444
</pre>
4545

4646
#### Specifying the "lazy_connect" parameter
4747
This option is useful when a cluster has many shards but not of them are necessarily used at one time.
4848
<pre>
49-
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("lazy_connect" => true)));
49+
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("lazy_connect" => true));
50+
</pre>
51+
52+
#### Specifying the "connect_timeout" parameter
53+
The connect_timeout value is a double and is used to specify a timeout in number of seconds when creating redis socket connections used in the RedisArray.
54+
<pre>
55+
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("connect_timeout" => 0.5));
5056
</pre>
5157

5258
#### Defining arrays in Redis.ini

0 commit comments

Comments
 (0)