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

Added keep-alive option to WCandidates #548

Merged
merged 1 commit into from
Jun 9, 2017

Conversation

qstokkink
Copy link
Contributor

@qstokkink qstokkink commented Jun 7, 2017

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 (see Community.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, call candidate.set_keepalive(None).

@qstokkink qstokkink force-pushed the keep_alive_wcandidate branch 3 times, most recently from d4c875e to 6be6092 Compare June 7, 2017 13:45
@qstokkink qstokkink changed the title WIP: Added keep-alive option to WCandidates READY: Added keep-alive option to WCandidates Jun 7, 2017
@qstokkink
Copy link
Contributor Author

@devos50 Ready for review. All Pylint violations are protected-access violations.

@qstokkink qstokkink changed the title READY: Added keep-alive option to WCandidates WIP: Added keep-alive option to WCandidates Jun 8, 2017
@qstokkink
Copy link
Contributor Author

Marking as WIP:

  • Add unloaded community detection

@qstokkink qstokkink force-pushed the keep_alive_wcandidate branch from 6be6092 to 7b30e9b Compare June 8, 2017 08:32
@qstokkink qstokkink changed the title WIP: Added keep-alive option to WCandidates READY: Added keep-alive option to WCandidates Jun 8, 2017
Copy link
Contributor

@devos50 devos50 left a 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
Copy link
Contributor

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.

@qstokkink qstokkink changed the title READY: Added keep-alive option to WCandidates WIP: Added keep-alive option to WCandidates Jun 9, 2017
@qstokkink qstokkink force-pushed the keep_alive_wcandidate branch from 7b30e9b to 39346e8 Compare June 9, 2017 12:54
@qstokkink qstokkink changed the title WIP: Added keep-alive option to WCandidates READY: Added keep-alive option to WCandidates Jun 9, 2017
@qstokkink
Copy link
Contributor Author

@devos50 Fixed 👍

@devos50 devos50 changed the title READY: Added keep-alive option to WCandidates Added keep-alive option to WCandidates Jun 9, 2017
@devos50
Copy link
Contributor

devos50 commented Jun 9, 2017

@qstokkink thanks!

@devos50 devos50 self-requested a review June 9, 2017 14:09
@devos50 devos50 merged commit a0f03db into Tribler:devel Jun 9, 2017
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.

2 participants