Skip to content

Instantly share code, notes, and snippets.

@adatta02
Created October 4, 2014 17:57
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save adatta02/842531b3fe93097ee030 to your computer and use it in GitHub Desktop.
<?php
$sharedParams = ["StreamName" => "some name", "ShardId" => "some id", "ShardIteratorType" => ShardIteratorType::LATEST];
$iterator = $client->getShardIterator( $sharedParams )->get("ShardIterator");
while( 1 ){
$recordResult = $client->getRecords( ["ShardIterator" => $iterator] );
$iterator = $recordResult->get("NextShardIterator");
$records = $recordResult->get("Records");
foreach( $records as $rec ){
// process your records
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment