private async Task GenerateShardIteratorRequest(KShard shard)
        {
            var shardIteratorRequest = new GetShardIteratorRequest()
            {
                ShardId                = shard.ShardId,
                ShardIteratorType      = shard.ShardIteratorType,
                StartingSequenceNumber = shard.SequenceNumber,
                StreamName             = _utilities.StreamName
            };

            var response = await _client.GetShardIteratorAsync(shardIteratorRequest, _cancellationTokenSource.Token);

            shard.SetNextShardIterator(response.ShardIterator);
        }
        private async Task <RecordResponse> GetRecordResponse(KShard shard, CancellationToken ctx)
        {
            var request = new GetRecordsRequest {
                ShardIterator = shard.ShardIterator
            };

            while (!ctx.IsCancellationRequested)
            {
                var record = await _client.GetRecordsAsync(request, ctx);

                if (record.Records.Count > 0)
                {
                    return(RecordResponse.Create(record, ctx));
                }

                request.ShardIterator = record.NextShardIterator;

                await Task.Delay(1000, ctx);
            }

            return(RecordResponse.Empty);
        }