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

Promise/async support? #280

Open
icetbr opened this issue Mar 20, 2019 · 2 comments
Open

Promise/async support? #280

icetbr opened this issue Mar 20, 2019 · 2 comments

Comments

@icetbr
Copy link

icetbr commented Mar 20, 2019

Hi there, I wonder if there is a specific reason to not use promises to enable await/async ? Would you recommend against a lib such as https://github.com/GeekBerry/nsqjs-promise?

Thanks

@dudleycarr
Copy link
Owner

I think it makes sense to support async on some of the methods just as connect, close or publish. However, it doesn't make sense for receiving messages since it's not a single return that you're waiting on. Events are a much better fit in that situation.

@icetbr
Copy link
Author

icetbr commented Mar 20, 2019

Good to know, thanks. Those were the ones I currently wanted to promisify, together with the 'ready' event.

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

No branches or pull requests

2 participants