First attempt to pull TPU into the server

This commit is contained in:
Greg Fitzgerald 2018-05-15 11:25:55 -06:00
parent 5855e18a4e
commit b826f837f8
2 changed files with 21 additions and 6 deletions

View File

@ -10,6 +10,7 @@ use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::thread::JoinHandle;
use std::time::Duration;
//use tpu::Tpu;
pub struct Server {
pub thread_hdls: Vec<JoinHandle<()>>,
@ -30,6 +31,7 @@ impl Server {
writer: W,
) -> Self {
let bank = Arc::new(bank);
let mut thread_hdls = vec![];
let rpu = Rpu::new(
bank.clone(),
start_hash,
@ -39,11 +41,24 @@ impl Server {
broadcast_socket,
respond_socket,
gossip,
exit,
exit.clone(),
writer,
);
Server {
thread_hdls: rpu.thread_hdls,
}
thread_hdls.extend(rpu.thread_hdls);
//let tpu = Tpu::new(
// bank.clone(),
// start_hash,
// tick_duration,
// me,
// events_socket,
// broadcast_socket,
// gossip,
// exit.clone(),
// writer,
//);
//thread_hdls.extend(tpu.thread_hdls);
Server { thread_hdls }
}
}

View File

@ -28,7 +28,7 @@ impl Tpu {
start_hash: Hash,
tick_duration: Option<Duration>,
me: ReplicatedData,
requests_socket: UdpSocket,
events_socket: UdpSocket,
broadcast_socket: UdpSocket,
gossip: UdpSocket,
exit: Arc<AtomicBool>,
@ -37,7 +37,7 @@ impl Tpu {
let packet_recycler = packet::PacketRecycler::default();
let (packet_sender, packet_receiver) = channel();
let t_receiver = streamer::receiver(
requests_socket,
events_socket,
exit.clone(),
packet_recycler.clone(),
packet_sender,