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

Rewrite a paragraph in the README and a couple trivial fixes #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dfinkel
Copy link
Contributor

@dfinkel dfinkel commented Mar 25, 2022

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.

Copy link

@sergiosalvatore sergiosalvatore left a 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,

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/

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.

Copy link
Contributor Author

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

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..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Base automatically changed from simple_context_failure_retries to master March 25, 2022 16:36
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.
@dfinkel dfinkel force-pushed the readme_cleanup_trivial_fixes branch from 452f327 to dbf3acb Compare March 25, 2022 19:30
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