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

Dynamic discovery for zmq server and client #91

Merged
merged 73 commits into from
Jun 13, 2013

Conversation

quixoten
Copy link
Contributor

This is ready for some initial feedback. So far only the server side is implemented. I based this branch off of my instantiate_runner_and_server branch.

localshred and others added 30 commits February 19, 2013 15:31
The ZMQ client connector implements the Lazy Pirate pattern as laid out
in the [ZMQ Guide - Chapter 4][lpp]. The essence is that we attempt to
be more stable in our client requests as we assume the server may not be
available for fulfilling responses.

A connection will be created to the server and data sent with a timeout
on the socket. If the socket becomes readable inside the timeout, we
read the data and go on our way.

If the socket does not become readable in the timeout, we will close and
reopen the socket, send the data again, and again wait for a valid
response or timeout.

If we exceed the number of tries we do not attempt the connection
anymore and we fail with a timeout message to the calling code.

  [lpp]:
  http://zguide.zeromq.org/php:chapter4#Client-side-Reliability-Lazy-Pirate-Pattern
By setting @running to true after the workers are started, it is
possible that the worker could check the servers running status before
it has been set, causing the worker to shutdown.
Conflicts:
	lib/protobuf/rpc/servers/zmq/server.rb
@quixoten
Copy link
Contributor Author

@localshred bump.

@localshred
Copy link
Contributor

Bump indeed. Gimme a bit to check this out.

debug_say('Configuring traps')

exit_signals = [:INT, :TERM]
exit_signals << :QUIT unless defined?(JRUBY_VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on only registering QUIT outside of JRuby.

@quixoten
Copy link
Contributor Author

@localshred 👋

@localshred
Copy link
Contributor

Now was that so hard? Bravo @devin-c 👏

localshred added a commit that referenced this pull request Jun 13, 2013
Dynamic discovery for zmq server and client
@localshred localshred merged commit 6297dc6 into ruby-protobuf:master Jun 13, 2013
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.

2 participants