pub struct GossipDiscovery { /* private fields */ }Expand description
Gossip-based discovery protocol
Implementations§
Source§impl GossipDiscovery
impl GossipDiscovery
Sourcepub fn new(
local_node: ClusterNode,
seed_nodes: Vec<SocketAddr>,
gossip_interval: Duration,
node_timeout: Duration,
) -> Self
pub fn new( local_node: ClusterNode, seed_nodes: Vec<SocketAddr>, gossip_interval: Duration, node_timeout: Duration, ) -> Self
Create a new gossip discovery service
Sourcepub fn merge_gossip(&self, remote_nodes: Vec<ClusterNode>)
pub fn merge_gossip(&self, remote_nodes: Vec<ClusterNode>)
Merge gossip information from another node
Sourcepub fn prune_failed_nodes(&self)
pub fn prune_failed_nodes(&self)
Remove failed nodes
Sourcepub fn get_stats(&self) -> GossipStats
pub fn get_stats(&self) -> GossipStats
Get gossip statistics
Trait Implementations§
Source§impl DiscoveryService for GossipDiscovery
impl DiscoveryService for GossipDiscovery
Source§fn discover_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClusterNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClusterNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Discover nodes in the cluster
Source§fn register_node<'life0, 'async_trait>(
&'life0 self,
node: ClusterNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_node<'life0, 'async_trait>(
&'life0 self,
node: ClusterNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register this node in the discovery service
Auto Trait Implementations§
impl Freeze for GossipDiscovery
impl !RefUnwindSafe for GossipDiscovery
impl Send for GossipDiscovery
impl Sync for GossipDiscovery
impl Unpin for GossipDiscovery
impl !UnwindSafe for GossipDiscovery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more