Delete Service trait (#6921)

This commit is contained in:
Greg Fitzgerald
2019-11-13 11:12:09 -07:00
committed by GitHub
parent 4b1e9ada18
commit a3a830e1ab
35 changed files with 57 additions and 222 deletions

View File

@ -2,7 +2,6 @@
use crate::cluster_info::{ClusterInfo, VALIDATOR_PORT_RANGE};
use crate::contact_info::ContactInfo;
use crate::service::Service;
use crate::streamer;
use rand::{thread_rng, Rng};
use solana_client::thin_client::{create_client, ThinClient};
@ -51,6 +50,13 @@ impl GossipService {
let thread_hdls = vec![t_receiver, t_responder, t_listen, t_gossip];
Self { thread_hdls }
}
pub fn join(self) -> thread::Result<()> {
for thread_hdl in self.thread_hdls {
thread_hdl.join()?;
}
Ok(())
}
}
/// Discover Nodes and Archivers in a cluster
@ -264,17 +270,6 @@ fn make_gossip_node(
(gossip_service, ip_echo, cluster_info)
}
impl Service for GossipService {
type JoinReturnType = ();
fn join(self) -> thread::Result<()> {
for thread_hdl in self.thread_hdls {
thread_hdl.join()?;
}
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;