Tribler / dispersy

The elastic database system. A database designed for P2P-like scenarios, where potentially millions of computers send database updates around.
http://www.tribler.org
84 stars 43 forks source link

Added keep-alive option to WCandidates #548

Closed qstokkink closed 7 years ago

qstokkink commented 7 years ago

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 commented 7 years ago

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

qstokkink commented 7 years ago

Marking as WIP:

qstokkink commented 7 years ago

@devos50 Fixed 👍

devos50 commented 7 years ago

@qstokkink thanks!