Skip to content

Abrandoned/config zmq#218

Merged
abrandoned merged 4 commits intomasterfrom
abrandoned/config_zmq
Sep 16, 2014
Merged

Abrandoned/config zmq#218
abrandoned merged 4 commits intomasterfrom
abrandoned/config_zmq

Conversation

@abrandoned
Copy link
Copy Markdown
Contributor

Moving the values that were hardcoded into the zmq broker/connector into environment variables with "reasonable" defaults (the defaults basically maintain the behavior before this PR)

PB_ZMQ_CLIENT_HOST_ALIVE_CHECK_INTERVAL - how many seconds between health checks
PB_ZMQ_CLIENT_SERVER_LOOKUP_ATTEMPTS - how many times to lookup the server in the service directory list
PB_ZMQ_SERVER_BACKEND_POLL_WEIGHT - in the broker this is how many backend reads will be executed if the backend socket is readable while processing the backend responses (defaults to 1)
PB_ZMQ_SERVER_FRONTEND_POLL_WEIGHT - in the broker this is how many frontend reads will be executed if the frontend socket is readable while processing the frontend requests (defaults to 1)

@liveh2o @localshred @quixoten

in the connector for zmq and the broker for zmq

the poll weight influences how many messages will be pulled from the
polling socket before it moves on to check the other socket, this is
currently 2/1 weighted in favor of the backend socket (the work
complete)

Also made a configuration value of the number of attempts to make on
getting the server uri on the client side
Comment thread lib/protobuf/rpc/servers/zmq/broker.rb Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason not to use += here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't like += other than that ..... no

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To me, it's much more readable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And why don't you like it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's shorthand, you know my pref to avoid abbrevs ;)

@localshred
Copy link
Copy Markdown
Contributor

My only concern is that the broker's run method is getting a little thick around the middle with this change. Any chance we can break up the backend/frontend while loops into their own methods?

@localshred
Copy link
Copy Markdown
Contributor

Something like check_backend_readables...

@abrandoned
Copy link
Copy Markdown
Contributor Author

on it

@abrandoned
Copy link
Copy Markdown
Contributor Author

@localshred

@liveh2o
Copy link
Copy Markdown
Contributor

liveh2o commented Sep 16, 2014

134d1af8-2ee1-11e4-939c-cbbfc28094e7

abrandoned added a commit that referenced this pull request Sep 16, 2014
@abrandoned abrandoned merged commit 236bcd2 into master Sep 16, 2014
@abrandoned abrandoned deleted the abrandoned/config_zmq branch September 16, 2014 00:28
@localshred
Copy link
Copy Markdown
Contributor

Like it. Perfect.

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.

3 participants