-
Notifications
You must be signed in to change notification settings - Fork 44
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
Added keep-alive option to WCandidates #548
Conversation
d4c875e
to
6be6092
Compare
@devos50 Ready for review. All Pylint violations are |
Marking as WIP:
|
6be6092
to
7b30e9b
Compare
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.
Other than my single comments, looks fine.
community.py
Outdated
@@ -1069,6 +1069,12 @@ def unload_community(self): | |||
|
|||
self.dispersy.detach_community(self) | |||
|
|||
def is_loaded(self): | |||
""" | |||
Is this community attached to Dispersy |
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.
Comment looks a bit weird, I would propose something like Returns whether this community is attached to Dispersy
.
7b30e9b
to
39346e8
Compare
@devos50 Fixed 👍 |
@qstokkink thanks! |
This PR adds the option for WalkCandidates to stay alive for a certain community (see
WalkCandidate.set_keepalive
).Once the WalkCandidate determines it has timed out for its respective category (see
WalkCandidate.get_category
), send a light-weight introduction request, without sync or advice so we are not introduced to new peers (seeCommunity.send_keep_alive
). If this does not get answered with an introduction response within the next timeout cycle, the WalkCandidate is timed out after all.For developers
If your community wants to keep a certain WalkCandidate as long as possible, call
candidate.set_keepalive(community)
to keep it until it goes offline. If you are no longer interested, callcandidate.set_keepalive(None)
.