Skip to content

Conversation

@tjmehta
Copy link

@tjmehta tjmehta commented Jul 1, 2016

Love substream and primus thanks for the modules!

This is a working attempt of adding event-emitter support to substreams (so that they emit events across the wire)

I am not super knowledgeable w/ substream, so please let me know if there are any side effects. Currently I am ignoring data and end events because they are already handled by substream.

I am also, unsure how you would like error events to be emitted across the wire. I was thinking of using http://npmrepo.com/error-to-json to convert the error to json before sending it over the wire, and then parsing as an error on the receiving end.

Let me know what you think.

Thanks!

@tjmehta
Copy link
Author

tjmehta commented Jul 1, 2016

Relevant Issues: #15 #17

Just realized there is another PR out (checking this out now): #16

*
* @param {String} event
* @param {*} ...args
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that emit now writes on the underlying connection but also emit the event to the instance it is called from. It looks wrong to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants