set channels sizes
This commit is contained in:
parent
ff3fbd2eb4
commit
d8ee59b964
@ -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}");
|
||||
|
Loading…
Reference in New Issue
Block a user