-
Notifications
You must be signed in to change notification settings - Fork 58
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
zmq_proxy and optional parameter #208
Comments
If you want to be able to pass function proxy(frontend::Socket, backend::Socket)
ccall((:zmq_proxy, libzmq),
Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
frontend, backend, C_NULL)
end |
Aha! Thanks for the reply! I discarded that option because it does not follow DRY principle, but maybe it is the right way in Julia for a simple thing like this. I will eventually open a PR with this simple proposal. |
So we now have an automatically-wrapped Lines 358 to 360 in e66c836
Which you should be able to call like e.g. function proxy(frontend::Socket, backend::Socket, capture=Union{Nothing, Socket})
capture_arg = isnothing(capture) ? C_NULL : capture
lib.zmq_proxy(frontend, backend, capture_arg)
end |
Because Might be nice to have a wrapper that helps with some of this in ZMQ.jl. |
Hum, interesting. What do you think about a pure Julia implementation of |
I'm not an expert both in Julia and zeromq and I was playing with this wrapper. My example uses the
zmq_proxy
, which is missing in the wrapper currently, and I managed to make it work.I would have open a PR with a minimal proposal, but I faced an issue that I'd like to know from you Julia and ZMQ.jl experts about how to address it.
The wrapper function would be something similar to
I have a few concerns about this function per se, but the main problem keeping me away from opening a PR is the fact that
context
may be NULL or a Socket, and I was not able to figure out a way in the ZMQ.jl design to create a "null" Socket (e.g. I may evaluate to add an additional Socket constructor that setsdata = C_NULL
, but then the problem is theSocket.pollfd
, which in turn I don't know anything about).The text was updated successfully, but these errors were encountered: