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

feat(asyncify): adds asyncify and asyncifyErrback #96

Merged
merged 2 commits into from
Oct 18, 2017
Merged

Conversation

mattpodwysocki
Copy link
Contributor

Description:

Adds the asyncify and asyncifyErrback to bind to callbacks to support regular callbacks and node style errBack callbacks to be bound to AsyncIterable.

Related issue (if exists):

@mattpodwysocki mattpodwysocki merged commit f75dfaf into master Oct 18, 2017
@leebyron
Copy link

leebyron commented Oct 18, 2017

I think these are only likely to be marginally valuable since awaiting a single value is typically better modeled as a Promise instead of an AsyncIter, and there are already tools out there to convert a node callback to a Promise (and tools to convert a Promise to an AsyncIter that resolves once). - you should make sure documentation for this clearly indicates that the AsyncIter will close after the callback is called once, since I think most would be surprised by that behavior (this is a multi-value streaming library after all).

I believe the tweet motivating this change was looking for conversion from a callback that's intended to be called multiple times into an AsyncIter that resolves multiple values - it would be great to have a utility for doing that.

@mattpodwysocki mattpodwysocki deleted the asyncify branch October 27, 2017 16:32
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.

3 participants