Skip to content

Commit

Permalink
use poll interval option
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck committed Feb 19, 2017
1 parent 2c598ea commit 404d40b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,11 @@ Reader readable stream too!
const reader = new KinesisStreamReader(client, streamName, options)
reader.pipe(yourDestinationHere)

### Options

* `interval` Milliseconds between each Kinesis read. Remember there is a low
limit of 5 reads / second / shard
* Any [getShardIterator] param

[Kafka quickstart]: http://kafka.apache.org/documentation.html#quickstart_consume
[getShardIterator]: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html#getShardIterator-property
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class KinesisStreamReader extends Readable {
setTimeout(() => {
this.readShard(data.NextShardIterator)
// idleTimeBetweenReadsInMillis http://docs.aws.amazon.com/streams/latest/dev/kinesis-low-latency.html
}, 2000)
}, this.interval)
})
}

Expand Down

0 comments on commit 404d40b

Please sign in to comment.