senyor-seymour-butts / SemanticP2P

0 stars 0 forks source link

Peers Queue #2

Open senyor-seymour-butts opened 8 years ago

senyor-seymour-butts commented 8 years ago

Because a given peer can host multiple projects it is wise to monitor at the peer level rather than the domain level. Peers should be inserted into a data structure which orders peers based on Least-Recently-Used (LRU). Where the LRU peer is at one end and the MRU peer is at the other.

Peers that are not frequently used are subject to be removed from the list and so are any references to them in the Domain Tree. Peers can only be removed by another peer. This implies there is a maximum peer list size of P. A reasonable value for P is yet to be determined. If peers are found to be unresponsive after so many attempts to contact them then they are flagged for removal, but are not actually deleted until another peer usurps their position.

This protocol is taken from Kademlia and protects against the case where your device goes offline sporadically.