This PR is mainly focused on the addition of pull-based gossiping, where peers iterate through their peer table sending out pull messages in an attempt to synchronize content on-demand. However, this PR also includes a number of other substantial changes.
Refactored the gossiper to be interface/struct based instead of function based. Although we use a more functional approach for low-level components, these higher-level components are better expressed using structs.
Removed explicit shouldReadNextMsg filtering in favor of implicit filtering through message receivers. Message receivers now return errors, which indicate to the channel.Client that the respective channel should be killed. Part of this involved moving away from chan wire.Msg based notifications to function callbacks.
Unified the Send, Gossip, and Sync functionality into the peer.Peer to make things simpler for the user.
This PR is mainly focused on the addition of pull-based gossiping, where peers iterate through their peer table sending out pull messages in an attempt to synchronize content on-demand. However, this PR also includes a number of other substantial changes.
shouldReadNextMsg
filtering in favor of implicit filtering through message receivers. Message receivers now return errors, which indicate to thechannel.Client
that the respective channel should be killed. Part of this involved moving away fromchan wire.Msg
based notifications to function callbacks.Send
,Gossip
, andSync
functionality into thepeer.Peer
to make things simpler for the user.