-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rewrite a paragraph in the README and a couple trivial fixes #13
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple small nits.
README.md
Outdated
to the current leader. (it can also be useful for debugging) | ||
|
||
Optionally, one can specify `LeaderChanged` and `OnOusting` callbacks which are | ||
called when a the current leader changes and an instance has lost its election, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/when a/when/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing i noticed about OnOusting
is that it seems to also be called when Acquire exits (unless i'm missing something...) which is not really a result of an election per-se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, WRT OnOusting
, it's called whenever losing leadership, whether that's because it lost the election or because it's been ceded.
I've reworded this paragraph a bit to explain this better.
Also, removed the extra a
README.md
Outdated
Each "candidate" contending for leadership must register an `OnElected` callback | ||
and a `LeaderID` (which is often a random string). Additionally, it is | ||
recommended to specify `HostPort`, which makes it possible to leverage the | ||
`legrpc` and have other clients using the `WatchConfig{}.Watch()` method connect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: perhaps "...the legrpc
package..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The error for the switch covering most of the body of the main loop of Acquire shouldn't be called `err`. Give it a better name.
Don't use fmt.Sprintf when you're just concatenating two strings.
The description of OnElected, OnOusting, and LeaderChanged are a bit misleading because of an interstitial clause. Rewrite that paragraph and break it up into two.
452f327
to
dbf3acb
Compare
Rewrite the README paragraph covering OnOusted and friends as two paragraphs that are not completely confusing.
Clean up an instance of string concatenation using
Sprintf
.Rename an
err
variable now that it has more variables in the scope it's interacting with.