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

m2reader.py PULLs Mongrel2 requests meant for Brubeck #66

Open
stuntgoat opened this issue Apr 23, 2012 · 5 comments
Open

m2reader.py PULLs Mongrel2 requests meant for Brubeck #66

stuntgoat opened this issue Apr 23, 2012 · 5 comments
Labels

Comments

@stuntgoat
Copy link
Contributor

I noticed that m2reader.py is using a 0mq PULL socket, which, when testing the websockets demo, steals every other message from Mongrel2. According to the 0mq documentation, PULL socket types respond to PUSH socket types; PUSH socket messages are sent 'round-robin' to all down stream nodes. That is, messages sent from Mongrel2 over the PUSH socket are alternately PULLed from Brubeck and the m2reader.py.

I think this is why my websocket requests are being eaten, so to speak, by m2reader.py. I don't know how you would want to fix this, since in order to get m2reader.py to stop eating messages it would have to be changed to a SUB socket type; this would require the Mongrel2 PUSH socket, that I am assuming Brubeck subscribes to, be changed to a PUB socket.

@j2labs
Copy link
Owner

j2labs commented Apr 26, 2012

Yes, that's correct. m2reader wasn't really designed to be a middle point between brubeck and mongrel2, but I think that might actually be a great idea.

@jordanorelli once proposed this and I think I shot it down then, but I'm realizing it's a good idea.

@j2labs
Copy link
Owner

j2labs commented May 16, 2012

Isaac, this could be a pretty awesome project. It would involve building a middle man between Mongrel2 and Brubeck such a message can be read from Mongrel2 and then forwarding it along.

I think it could be a little tricky for users since it would have to introduce an addition ZeroMQ socket to consideration. I'm not sure how to handle that yet.

@stuntgoat
Copy link
Contributor Author

I wonder if it would be as simple as passing log=True to the Connection class. If True, open a zmq PUB socket to forward the zmq_msg acquired in self.recv, before returning it. Something(s) could open a zmq SUB socket to the logger socket. This should receive every message sent from Mongrel2 to Brubeck and allow for multiple clients to read from the logger.

@j2labs
Copy link
Owner

j2labs commented May 16, 2012

Yes! Great idea!

Wanna try implementing it? It will probably require adjustments to brubeck.connections too, meaning this should also work for WSGI messages.

On Wednesday, May 16, 2012 at 2:06 PM, Isaac wrote:

I wonder if it would be as simple as passing log=True to the Connection class. If True, open a zmq PUB socket to forward the zmq_msg acquired in self.recv, before returning it. Something(s) could open a zmq SUB socket to the logger socket. This should receive every message sent from Mongrel2 to Brubeck and allow for multiple clients to read from the logger.


Reply to this email directly or view it on GitHub:
#66 (comment)

@stuntgoat
Copy link
Contributor Author

Great! Yes, I'll take a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants