set channels sizes

This commit is contained in:
Marc Planard 2023-10-14 23:27:42 +02:00
parent ff3fbd2eb4
commit d8ee59b964

View File

@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.filter(| url | url.host() != addr.host())
.collect();
let (tx, mut rx) = mpsc::channel(32);
let (tx, mut rx) = mpsc::channel(WORKERS);
// spawn a pool of workers
let mut workers : Vec<Option<Sender<Url>>> = (0..WORKERS)
@ -57,7 +57,7 @@ fn spawn_worker(
id: usize,
tx: Sender<(usize,Option<SiteStat>)>
) -> Sender<Url> {
let (tx1, mut rx) = mpsc::channel::<Url>(16);
let (tx1, mut rx) = mpsc::channel::<Url>(1);
tokio::spawn(async move {
println!("Start worker {id}");