-
Notifications
You must be signed in to change notification settings - Fork 20
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
any plans to rewrite bramqp in async/await? #56
Comments
I dont have any immediate plans to update bramqp to use more modern javascript features, but it is something I have thought about. Updating the callbacks to something more suitable does make sense, but the library does function as is. Another consideration is which version of node is supported. Currently, bramqp works with node all the way back to version 0.10 |
If I am not mistaken, node since v. 7.0.0 does natively support async/await |
With the release of many of the important async / await features in node 12, I am happy to refactor bramqp to use promises. My plan is to have the interface look something like:
|
Just wanted to give an update. I have built out some async prototypes and looked into a few strategies here. The branches In addition to vanilla features, node also provides streams. While this interface is a bit different, it seems more suitable for bramqp internals as it contains piping and flow control. My work on converting bramqp to use duplex streams is more complete than the other two branches but it is not entirely finished. It available in the With this new interface, each level of amqp is a stream (handle, channel, class, method). Data can be sent to the server by writing to the stream using the appropriate interface. Methods may also be called and will send the data to the stream. These streams also produce data when it is received from the server. |
just came across this article regarding node streams: https://github.com/nodejs/readable-stream hope this helps :) |
Thanks for the insight but maybe I don't see the same issues with the stock streams as that author does. The blog post is from 2014 and is mainly raising issue with changing interfaces from streams in node 0.8-0.10. These node versions are quite old so I am fine relying on stock streams3 from node 12 onward rather than adding more to the npm install. |
...this would be very handy for modern NodeJS
The text was updated successfully, but these errors were encountered: