How to use the readable function from event-stream

Find comprehensive JavaScript event-stream.readable code examples handpicked from public code repositorys.

12
13
14
15
16
17
18
19
20
21
var key = new Buffer(options.key),
    client = options.client,
    maxReadLength = options.maxReadLength || DEFAULT_READ_LENGTH,
    current = 0;

return es.readable(function(count, callback) {
  var that = this;
  client.getrange(key, current, current + maxReadLength - 1, function(err, data) {
    if (err) {
      that.emit('error', err);
fork icon0
star icon0
watch icon0