B:BD[
3.221] → [
3.221:320]
B:BD[
4.516] → [
4.516:590]
B:BD[
4.590] → [
3.321:381]
B:BD[
4.640] → [
4.640:650]
B:BD[
4.650] → [
3.382:399]
let dict_ref = Box::leak(dict);
LocalExecutorBuilder::default().spawn(move || async move {
let listener = TcpListener::bind("0.0.0.0:8000").unwrap();
loop {
let stream = listener.accept().await.unwrap();
spawn_local(handle(stream, dict_ref)).detach();
}
}).unwrap();
let dict_ref: &'static DashSet<String, FxBuildHasher> = Box::leak(dict);
let mut handles = Vec::new();
for i in 0..num_cpus::get() {
handles.push(LocalExecutorBuilder::new(Placement::Fixed(i)).spawn(move || async move {
let listener = TcpListener::bind("0.0.0.0:8000").unwrap();
loop {
let stream = listener.accept().await.unwrap();
spawn_local(handle(stream, dict_ref)).detach();
}
}).unwrap());
}
for handle in handles {
handle.join().unwrap();
}