Last active
August 29, 2015 14:13
-
-
Save gonzaloserrano/e3cd6a4307b7d9c8e26c to your computer and use it in GitHub Desktop.
phpredis reconnection failing test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// redis docker containers | |
$serversList = array( | |
'redis1', | |
'redis2', | |
'redis3', | |
'redis4', | |
'redis5', | |
); | |
$ra = new RedisArray( | |
$serversList, | |
array( | |
"connect_timeout" => 10, | |
"retry_timeout" => 3000, | |
"retry_interval" => 3000 | |
) | |
); | |
//$ra = new RedisArray($serversList); | |
$key = 'key'; | |
$value = 'value'; | |
$i = 0; | |
while (true) { | |
echo "\n\n### $i"; | |
for ($j = 0; $j < 5; $j++) { | |
$_key = $key . $j; | |
echo "\n" . $ra->_target($_key); | |
echo " > set: $j"; | |
$ra->set($_key, $j); | |
echo "\nget: " . $ra->get($_key); | |
} | |
sleep(1); | |
echo "\nsleep\n"; | |
$i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment