Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
for( $a=1; $a<20; $a++ ) {
echo '----------------------' . PHP_EOL;
echo 'PROJECT_ID :: ' . $a . PHP_EOL;
$last = $c[ 'predis' ]->get( 'round-robin-dispatch' );
$i = $j = -1;
$n = count( $array );
if( isset( $last )) {
$i = $j = $last;
}
do {
$j = ( $j + 1 ) % $n;
if( isset( $array[$j] ) ) {
$i = $j;
$c[ 'predis' ]->set( 'round-robin-dispatch', $i );
$current = $array[ $i ];
}
} while ( $j != $i );
echo 'Will be sent to :: ' . $current . PHP_EOL;
echo 'Will be sent to :: aviva' . PHP_EOL;
sleep( 2 );
}
echo PHP_EOL; **/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.