Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Add collision avoidance to thaliPeerPool #651
When a new peer appears and starts to advertise itself, there should be a random delay before clients try to connect to it in order to avoid collisions. Otherwise all clients try to connect to the same peer at the same time. This can be implemented in thaliPeerPool.
Actually this shouldn't be handled in thaliPeerPool because the peer pool doesn't really know anything about the semantics of an event. It would make more sense to put this into the notification code so that we essentially delay calling enqueue for a random period of time. Alternatively we could put a delay into the notification action itself so that it uses a time out before it makes a HTTP request.