Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherit from Stream #8

Merged
merged 4 commits into from
Mar 21, 2011

Conversation

TooTallNate
Copy link
Contributor

Here's a few commit's that make the 'SerialPort' class inherit from stream.Stream, rather than EventEmitter. This gives us the .pipe() function. I've also included a commit that does better handling of the 'options' argument when creating a 'SerialPort' instance.

This lib is fun though! Can't wait to try it with some real hardware!

@voodootikigod
Copy link
Collaborator

I like the stream change, but not the options change. I do want to know what/if any (beyond to be more inline with other node concepts) moving to pipe gets us. Ping me at voodootikigod any IM/IRC we can chat.

@TooTallNate
Copy link
Contributor Author

You like the options change, I think you just don't know it yet :P

And ya, the Stream change is just to be more in line with the Node APIs. More specifically, I would like to implement the serial side of the Modbus protocol in my node-modbus-stack module:
https://github.com/TooTallNate/node-modbus-stack

But that requires the underlying stream to be a real instance of Stream, otherwise the StreamStack constructor will throw an error, so this patch will allow me to use the serialport "stream" instance with StreamStack:
https://github.com/TooTallNate/node-stream-stack

I'll be on #Node.js today if you want to chat more about it!

@voodootikigod
Copy link
Collaborator

I dig the revision, hybrid of the two. I am not a fan of using proto but can forgo my purist sensibles in favor of the cleanliness (and compactness) of it.

@voodootikigod voodootikigod merged commit 782af52 into serialport:master Mar 21, 2011
reconbot added a commit that referenced this pull request Jul 24, 2018
reconbot added a commit that referenced this pull request Jul 24, 2018
reconbot added a commit that referenced this pull request Jul 24, 2018
reconbot added a commit that referenced this pull request Jul 24, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants