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/developerproviding 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;
}