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

zmq_proxy / ZMQ::Poll in Actor #33

Open
alhafoudh opened this issue Mar 1, 2014 · 9 comments
Open

zmq_proxy / ZMQ::Poll in Actor #33

alhafoudh opened this issue Mar 1, 2014 · 9 comments

Comments

@alhafoudh
Copy link

Hi,
how to properly start and handle zmq_proxy or at least ZMQ::Poll?

For example for ROUTER and DEALER socket pair.

@Asmod4n
Copy link

Asmod4n commented Mar 5, 2014

Its rather straightforward how to do DEALER and ROUTER stuff, made a small gist for it https://gist.github.com/Asmod4n/9372750 /cc @tarcieri

@alhafoudh
Copy link
Author

Thanks for the example, but I cannot see the proxying of the messages from ROUTER to DEALER and back in the example.

@Asmod4n
Copy link

Asmod4n commented Mar 5, 2014

The server(dealer) sends messages to the handler(router), the handler then sends information back and the server reads them.

@alhafoudh
Copy link
Author

I am not quite sure to which ZMQ pattern are you referring to, but I refer to this pattern:

http://zguide.zeromq.org/page:all#Shared-Queue-DEALER-and-ROUTER-sockets
https://github.com/imatix/zguide/raw/master/images/fig16.png

ROUTER and DEALER are on same node and passing messages internally e.g. proxying

I apologize if this was not clear from the issue description.

@alhafoudh
Copy link
Author

As I understand the polling in Reactor is to do the the actor signaling efficient, but I need to make another Poller inside an Actor with two sockets. The DealerSocker and RouterSocket.
Yes, the Device in ffi-rzmq is exactly what I need, but the celluloid-zmq does not play well with it :(

@Asmod4n
Copy link

Asmod4n commented Mar 5, 2014

I believe you have to run it in its own actor.

At least the specs here do it that way https://github.com/chuckremes/ffi-rzmq/blob/master/spec/device_spec.rb#L30 ^^

@alhafoudh
Copy link
Author

Yes, but when zmq_proxy is called the program control is never returned and this is a problem for celluloid actors

@Asmod4n
Copy link

Asmod4n commented Sep 22, 2014

@alhafoudh https://github.com/zeromq/czmq will sonnish(i hope) release a 3.0 version of its high level C binding which does this in the background.
I have written a ruby ffi wrapper for it which i will release once they release czmq 3, that wrapper will then maybe become the new basis for celluloid-zmq.

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