Rewrite a paragraph in the README and a couple trivial fixes#13
Open
Rewrite a paragraph in the README and a couple trivial fixes#13
Conversation
sergiosalvatore
approved these changes
Mar 25, 2022
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.
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.
Contributor
Author
There was a problem hiding this comment.
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.
nit: perhaps "...the legrpc package..."
sachinagada
approved these changes
Mar 25, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
errvariable now that it has more variables in the scope it's interacting with.