Closed Asmod4n closed 10 years ago
So.. the wait_writable locks the process :?
@Asmod4n the process? On what VM?
@tarcieri travis, the socket tests don't do anything, it times them out after 10 minutes.
No idea what it is, really.
Can you somehow trigger another travis run? Locally the tests pass @tarcieri
I need this functionality for https://github.com/Asmod4n/celluloid-zmq-zap :)
Hrm, i still have no idea why it doesn't do anything. I believe inproc changed between zmq 3 and 4.
@Asmod4n we should have Travis install the Ubuntu package first
@tarcieri there is no zmq4 package for ubuntu 12.04 (which travis uses, maybe they add 14.04. soonish), have to fetch it from git and compile it :<
But i find it quite amusing(?) that the specs run successfully on ruby-head: https://travis-ci.org/celluloid/celluloid-zmq/jobs/20446393
I've been testing this branch with a "Router" server. The ZMQ.wait_writable
in WritableSocket#write
causes lots of pain when handling simultaneous requests as it prevents a response from been written on the socket.
Removing the line allows responses to be sent without issue in multiple threads over the same socket. Perhaps I'm missing something as to why this was added?
Could you try https://github.com/Asmod4n/celluloid-zmq-zap/blob/master/examples/curve_redis.rb out with wait_writeable disabled? Afaik i had it in because without it i was getting protocol errors.
You have to comment out Line 61 here https://github.com/Asmod4n/celluloid-zmq-zap/blob/master/lib/celluloid/zmq/zap/celluloid-zmq-ext.rb
I haven't tried your specific example with all the complex curve stuff, but I set-up something similar with the Dealer-Router pattern. Worked fine! Here's my gist:
https://gist.github.com/samlown/10299933
However, I've always found it much easier to use the Req-Router pattern where each incoming request has it's own socket, that way you don't need to deal with matching responses.
Will try it later tomorrow if it still functions without the wait_writable, or else just use it in the Dealer Socket myself.
Sending and recieving multipart string messages is only supported on XREQ, XREP, Router and Dealer sockets, afaik. At least i couldn't get it to work with normal REQ, REP sockets.