Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (20 sloc) 0.66 kb
<?php
echo "Starting\n";
// try loading server definitions from specified file.
// ketama_roll will automatically re-read the contents
// whenever the file changes.
$continuum = ketama_roll( "ketama.servers" );
if ( !$continuum )
die( "Continuum doesn't exist!\n" );
// find the matching server for key $i in the continuum
// specified by resource $continuum.
for ( $i = 0; $i < 25; $i++ )
{
$server = ketama_get_server( $i, $continuum );
echo "Key " .$i. " is mapped to server " . $server[ "ip" ] . " ".
"at point: " . $server[ "point" ] . "\n";
}
// not strictly needed (will be auto-cleaned)
ketama_destroy( $continuum );
echo "Finished\n";
?>
Jump to Line
Something went wrong with that request. Please try again.