-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
discussionNeeds further discussion to reach desicionNeeds further discussion to reach desiciont:cluster:swim
Milestone
Description
We could do
/// Peer Selection is a common step in various gossip protocols.
///
/// Selecting a peer may be as trivial as randomly selecting one among known actors or nodes,
/// round-robin cycling through peers or a mix thereof in which the order is randomized _but stable_
/// which reduces the risk of gossiping to the same or starving certain peers in situations when many
/// new peers are added to the group.
///
/// // TODO: implement SWIMs selection in terms of this
public protocol PeerSelection {
associatedtype Peer: Hashable
public typealias Peers = [Peer]
associatedtype Payload: Equatable
func onMembershipEvent(event: Cluster.Event)
func select(for payload: Payload?) -> Peers
}if we want to reuse it among other impls.
E.g. SWIM has a pretty good strategy and it might be good to use for our other gossips as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
discussionNeeds further discussion to reach desicionNeeds further discussion to reach desiciont:cluster:swim