Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
client/network: Adjust wording (#6755)
Browse files Browse the repository at this point in the history
Rename `NetworkWorker::from_worker` to `NetworkWorker::from_service` as
it is a channel from the `NetworkService` to the `NetworkWorker`.
  • Loading branch information
mxinden authored Jul 29, 2020
1 parent 4e832cd commit aaf1aa8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
&params.network_config.transport,
)?;

let (to_worker, from_worker) = tracing_unbounded("mpsc_network_worker");
let (to_worker, from_service) = tracing_unbounded("mpsc_network_worker");

if let Some(path) = params.network_config.net_config_path {
fs::create_dir_all(&path)?;
Expand Down Expand Up @@ -361,7 +361,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
network_service: swarm,
service,
import_queue: params.import_queue,
from_worker,
from_service,
light_client_rqs: params.on_demand.and_then(|od| od.extract_receiver()),
event_streams: out_events::OutChannels::new(params.metrics_registry.as_ref())?,
metrics,
Expand Down Expand Up @@ -843,7 +843,7 @@ enum ServiceToWorkerMsg<B: BlockT, H: ExHashT> {
/// Main network worker. Must be polled in order for the network to advance.
///
/// You are encouraged to poll this in a separate background thread or task.
#[must_use = "The NetworkWorker must be polled in order for the network to work"]
#[must_use = "The NetworkWorker must be polled in order for the network to advance"]
pub struct NetworkWorker<B: BlockT + 'static, H: ExHashT> {
/// Updated by the `NetworkWorker` and loaded by the `NetworkService`.
external_addresses: Arc<Mutex<Vec<Multiaddr>>>,
Expand All @@ -855,10 +855,10 @@ pub struct NetworkWorker<B: BlockT + 'static, H: ExHashT> {
service: Arc<NetworkService<B, H>>,
/// The *actual* network.
network_service: Swarm<B, H>,
/// The import queue that was passed as initialization.
/// The import queue that was passed at initialization.
import_queue: Box<dyn ImportQueue<B>>,
/// Messages from the `NetworkService` and that must be processed.
from_worker: TracingUnboundedReceiver<ServiceToWorkerMsg<B, H>>,
/// Messages from the [`NetworkService`] that must be processed.
from_service: TracingUnboundedReceiver<ServiceToWorkerMsg<B, H>>,
/// Receiver for queries from the light client that must be processed.
light_client_rqs: Option<TracingUnboundedReceiver<light_client_handler::Request<B>>>,
/// Senders for events that happen on the network.
Expand Down Expand Up @@ -1137,7 +1137,7 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {

loop {
// Process the next message coming from the `NetworkService`.
let msg = match this.from_worker.poll_next_unpin(cx) {
let msg = match this.from_service.poll_next_unpin(cx) {
Poll::Ready(Some(msg)) => msg,
Poll::Ready(None) => return Poll::Ready(()),
Poll::Pending => break,
Expand Down

0 comments on commit aaf1aa8

Please sign in to comment.