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

Fix PUB/SUB topics support #37

Closed
wants to merge 2 commits into from
Closed

Fix PUB/SUB topics support #37

wants to merge 2 commits into from

Conversation

drr00t
Copy link

@drr00t drr00t commented Sep 13, 2014

Hi, PR to fix #31 issue, we need expose internal constants in a better way, i don't like this.

var nn = nano._bindings;
sub.setsockopt(nn.NN_SUB, nn.NN_SUB_SUBSCRIBE, 'my.topic');

thank you for bind Nick.

case 'sub_subscribe':
option = nn.NN_SUB_SUBSCRIBE;
break;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need a switch block when a single conditional would suffice?

@nickdesaulniers
Copy link
Owner

@tcr what are your thoughts on this?

@drr00t
Copy link
Author

drr00t commented Sep 16, 2014

Hi, sorry about that.

I should have removed it, I was thinking of a way to inform the constants but i didn´t like and i forgot.

My idea is do something like this to expose constants: https://github.com/JustinTulloss/zeromq.node/blob/master/lib/index.js#L93

This would be changed too: https://github.com/nickdesaulniers/node-nanomsg/blob/master/lib/index.js#L19

We won´t need pass enums like strings anymore: https://github.com/nickdesaulniers/node-nanomsg/blob/master/lib/index.js#L19

@asafyish
Copy link

asafyish commented Mar 9, 2015

+1

@nickdesaulniers
Copy link
Owner

completed in PR: #65, will publish updated version soon!

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.

Pub/Sub on a particular topic?
3 participants