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

Supplying Flag to utils.SendMessage #18

Closed
Dragomir-Ivanov opened this issue Sep 14, 2014 · 7 comments
Closed

Supplying Flag to utils.SendMessage #18

Dragomir-Ivanov opened this issue Sep 14, 2014 · 7 comments

Comments

@Dragomir-Ivanov
Copy link

Hi there,
Is there any reason why we can't suppli Flag(DONTWAIT) to utils.SendMessage functions. If there is no particular reson, perhaps I can supply a pull request.

Thanks,
Dragomir

@pebbe
Copy link
Owner

pebbe commented Sep 15, 2014

Never thought about using DONTWAIT on this function.

One practical reason is that one of the flags, SENDMORE, is already set or unset by the function internally. An other reason is that you can't add an argument after an argument with three dots. (Or can you?)

I could add a function SendMessageDontwait or SendMessageDontWait. What would be the best name?

@pebbe
Copy link
Owner

pebbe commented Sep 15, 2014

Done.

@pebbe pebbe closed this as completed Sep 15, 2014
@Dragomir-Ivanov
Copy link
Author

Technically, SendMessage accepts interface{} arguments, so it can be easy to check if the last one is of type zmq3.Flag. This way it will backward compatible and ideomatic.
Thanks :)

@pebbe
Copy link
Owner

pebbe commented Sep 15, 2014

But what if the user wants to send a flag as the last part of the message?

@Dragomir-Ivanov
Copy link
Author

Okay you are right, but I find it unlikely someone will need to send zmq3.Flag as a payload. That way as you did it today is fine, though. Thank you.

@Dragomir-Ivanov
Copy link
Author

Also I see that EAGAIN = Errno(C.EAGAIN) is missing from zmq3 (errors.go). Can you add it too. Thanks.

@pebbe
Copy link
Owner

pebbe commented Sep 15, 2014

EAGAIN is a standard error and available in package syscall.

For usage, see: http://godoc.org/github.com/pebbe/zmq3#AsErrno

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

2 participants