i am working on simple node js module... 
 a module that, when i give an ID and a request rate, returns a readable 
stream which emits location data for the corresponding satellite...
 i am trying to implement by using sub classing ReadableStream

 http://nodejs.org/api/stream.html#stream_class_stream_readable

 i am using this api

 http://wheretheiss.at/w/developer

providing my code below..

i am not sure how to include the api

http://jsfiddle.net/cc75cm3k/

function SimpleProtocol(source, options) {
  if (!(this instanceof SimpleProtocol))
    return new SimpleProtocol(source, options);

  Readable.call(this, options);
  this._inBody = false;
  this._sawFirstCr = false;

  // source is a readable stream, such as a socket or file
  this._source = source;

  var self = this;
  source.on('end', function() {
    self.push(null);
  });

  // give it a kick whenever the source is readable
  // read(0) will not consume any bytes
  source.on('readable', function() {
    self.read(0);
  });

  this._rawHeader = [];
  this.header = null;
}

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/67913208-88f9-4ef2-96cf-971b87b6f553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to