Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?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