convert std::sync::mpsc to crossbeam_channel (#22264)

This commit is contained in:
Jeff Biseda
2022-01-11 02:44:46 -08:00
committed by GitHub
parent 3c44d405c7
commit 8b66625c95
81 changed files with 313 additions and 346 deletions

View File

@@ -11,6 +11,7 @@ edition = "2021"
[dependencies]
bincode = "1.3.3"
crossbeam-channel = "0.5"
futures = "0.3"
solana-banks-interface = { path = "../banks-interface", version = "=1.10.0" }
solana-runtime = { path = "../runtime", version = "=1.10.0" }

View File

@@ -1,5 +1,6 @@
use {
bincode::{deserialize, serialize},
crossbeam_channel::{unbounded, Receiver, Sender},
futures::{future, prelude::stream::StreamExt},
solana_banks_interface::{
Banks, BanksRequest, BanksResponse, BanksTransactionResultWithSimulation,
@@ -30,10 +31,7 @@ use {
convert::TryFrom,
io,
net::{Ipv4Addr, SocketAddr},
sync::{
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
},
sync::{Arc, RwLock},
thread::Builder,
time::Duration,
},
@@ -96,7 +94,7 @@ impl BanksServer {
block_commitment_cache: Arc<RwLock<BlockCommitmentCache>>,
poll_signature_status_sleep_duration: Duration,
) -> Self {
let (transaction_sender, transaction_receiver) = channel();
let (transaction_sender, transaction_receiver) = unbounded();
let bank = bank_forks.read().unwrap().working_bank();
let slot = bank.slot();
{
@@ -392,7 +390,7 @@ pub async fn start_tcp_server(
// serve is generated by the service attribute. It takes as input any type implementing
// the generated Banks trait.
.map(move |chan| {
let (sender, receiver) = channel();
let (sender, receiver) = unbounded();
SendTransactionService::new::<NullTpuInfo>(
tpu_addr,