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

propose a v2 api #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

propose a v2 api #3

wants to merge 9 commits into from

Conversation

dominictarr
Copy link
Owner

Trying to make this ready to actually use, I want to suggest these changes.

To create a connection it must take a callback,
you could return a stream, but then you get ECONREFUSED errors in the stream,
which probably means the error ends up in a part of the app that doesn't know how to handle that error.
Also, this is simpler.

Some complication is added when you connect to a domain name - it has to do a lookup,
you can actually return the stream sync on the client and the server if you don't need a lookup.

@dignifiedquire
Copy link
Collaborator

👍 on moving to a callback, I went back and forth over this in my head, but in the head using a callback instead of immediately returning a stream makes it much easier to separate the concerns of error handling as you mention.

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