dudleycarr / nsqjs

NodeJS client library for NSQ
https://nsqjs.com
MIT License
558 stars 75 forks source link

Promise/async support? #280

Open icetbr opened 5 years ago

icetbr commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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