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

Add promises? #196

Closed
jez9999 opened this issue Nov 5, 2017 · 5 comments
Closed

Add promises? #196

jez9999 opened this issue Nov 5, 2017 · 5 comments

Comments

@jez9999
Copy link

jez9999 commented Nov 5, 2017

Is this library going to get promise support? It should be implemented. I would like to be able to say, for example:

function doBind(socket: zmq.Socket) {
    socket
        .bind("tcp://1.2.3.4:8181")
        .then(function(data) {
            ...
        })
        .catch(function(err) {
            ...
        });
}

Yes, you can promisify stuff, but that breaks TypeScript because it only promisify's at runtime. The correct way to fix it is to add promise implementation to the original library.

@rolftimmermans
Copy link
Member

Recently I started work on a new implementation that solves a number of API issues with the current version of the library. All API methods are based on promises. It also includes TypeScript definitions. Please see zeromq-ng.

Your feedback on the API would be helpful. My goal is to have it replace this library, or otherwise make it a production-ready viable alternative. Right now it mostly needs testing from users like you.

@jez9999
Copy link
Author

jez9999 commented Nov 6, 2017

@rolftimmermans How mature is it? Not sure I want to use a beta library in my production code. :-) Also it's kind of annoying that it has to be a separate project; we already have zmq and zeromq for some reason, now a third? :-)

@rolftimmermans
Copy link
Member

Well, I need your help to push it forward and maybe replace the current library. For now, maybe you can comment on the API, see what the impact on your project would be and run any test suite you may have with it?

@rgbkrk
Copy link
Member

rgbkrk commented Nov 6, 2017

Also check out the discussion in #189 -- I'd say maintainers are generally in favor of it. I'll add some other comments there.

@rolftimmermans
Copy link
Member

The latest 6.0 beta release incorporates all changes proposed in #189 and more. It would be great if you could try it out! The new version has an API that addresses some fundamental issues with the previous API, but it does include a compatibility layer that should make upgrading easier.

If you run into any problems feel free to report it here or in a new issue.

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

No branches or pull requests

3 participants