ws: rename request workers to swarm workers

This commit is contained in:
Joakim Frostegård 2022-07-04 11:55:53 +02:00
parent 224d50e98b
commit 12fc8bcf1e
5 changed files with 18 additions and 18 deletions

View file

@ -1,2 +1,2 @@
pub mod request;
pub mod socket;
pub mod swarm;

View file

@ -352,7 +352,7 @@ impl ConnectionReader {
)
.await
.unwrap();
::log::info!("sent message to request worker");
::log::info!("sent message to swarm worker");
} else {
self.send_error_response("Info hash not allowed".into(), Some(info_hash))
.await?;
@ -404,7 +404,7 @@ impl ConnectionReader {
.send_to(consumer_index, (meta, in_message))
.await
.unwrap();
::log::info!("sent message to request worker");
::log::info!("sent message to swarm worker");
}
}
}
@ -541,7 +541,7 @@ impl ConnectionWriter {
}
fn calculate_in_message_consumer_index(config: &Config, info_hash: InfoHash) -> usize {
(info_hash.0[0] as usize) % config.request_workers
(info_hash.0[0] as usize) % config.swarm_workers
}
fn create_tcp_listener(

View file

@ -127,7 +127,7 @@ impl TorrentMaps {
}
}
pub async fn run_request_worker(
pub async fn run_swarm_worker(
_sentinel: PanicSentinel,
config: Config,
state: State,
@ -223,14 +223,14 @@ async fn handle_request_stream<S>(
};
for (meta, out_message) in out_messages.drain(..) {
::log::info!("request worker trying to send OutMessage to socket worker");
::log::info!("swarm worker trying to send OutMessage to socket worker");
out_message_senders
.send_to(meta.out_message_consumer_id.0, (meta, out_message))
.await
.expect("failed sending out_message to socket worker");
::log::info!("request worker sent OutMessage to socket worker");
::log::info!("swarm worker sent OutMessage to socket worker");
}
},
)