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

Added multipart string reader #34

Closed
wants to merge 2 commits into from
Closed

Added multipart string reader #34

wants to merge 2 commits into from

Conversation

Asmod4n
Copy link

@Asmod4n Asmod4n commented Mar 5, 2014

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-65.96%) when pulling c25bb2f on Asmod4n:patch-1 into 4c2ab1a on celluloid:master.

@Asmod4n
Copy link
Author

Asmod4n commented Mar 5, 2014

So.. the wait_writable locks the process :?

@tarcieri
Copy link
Member

tarcieri commented Mar 5, 2014

@Asmod4n the process? On what VM?

@Asmod4n
Copy link
Author

Asmod4n commented Mar 5, 2014

@tarcieri travis, the socket tests don't do anything, it times them out after 10 minutes.

No idea what it is, really.

@Asmod4n
Copy link
Author

Asmod4n commented Mar 10, 2014

Can you somehow trigger another travis run? Locally the tests pass @tarcieri

I need this functionality for https://github.com/Asmod4n/celluloid-zmq-zap :)

@Asmod4n
Copy link
Author

Asmod4n commented Mar 10, 2014

Hrm, i still have no idea why it doesn't do anything. I believe inproc changed between zmq 3 and 4.

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.
@tarcieri
Copy link
Member

@Asmod4n we should have Travis install the Ubuntu package first

@Asmod4n
Copy link
Author

Asmod4n commented Mar 12, 2014

@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

@samlown
Copy link

samlown commented Apr 9, 2014

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?

@Asmod4n
Copy link
Author

Asmod4n commented Apr 9, 2014

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

@samlown
Copy link

samlown commented Apr 9, 2014

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.

@Asmod4n
Copy link
Author

Asmod4n commented Apr 9, 2014

Will try it later tomorrow if it still functions without the wait_writable, or else just use it in the Dealer Socket myself.

@Asmod4n Asmod4n closed this Aug 8, 2014
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

Successfully merging this pull request may close these issues.

4 participants