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

Document NextId.__init__() kwargs in docstring #592

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pottery/nextid.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ def __init__(self,
raise_on_redis_errors: bool = False,
num_tries: int = NUM_TRIES,
) -> None:
'''Initialize a NextId ID generator.

Keyword arguments:
key -- a string that identifies your ID sequence (e.g., 'tweets')
masters -- the Redis clients used to achieve quorum for this ID
generator
raise_on_redis_errors -- whether to raise the QuorumIsImplssible
exception when too many Redis masters throw errors
num_tries -- the number of times to try to achieve quorum before
giving up and raising the QuorumNotAchieved exception
'''
super().__init__(
key=key,
masters=masters,
Expand Down Expand Up @@ -236,7 +247,7 @@ def __current_id(self, value: int) -> None:
)

def reset(self) -> None:
'Reset the ID counter to 0.'
'Reset the ID generator to 0.'
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = set()
for master in self.masters:
Expand Down