Rename runtime_handle to executor

This commit is contained in:
pawan
2020-05-20 13:00:39 +05:30
parent 6d3503c05f
commit 8be6a4ecd5
13 changed files with 51 additions and 57 deletions

View File

@@ -222,7 +222,7 @@ where
.clone();
let (network_globals, network_send) =
NetworkService::start(beacon_chain, config, context.runtime_handle, context.log)
NetworkService::start(beacon_chain, config, context.executor, context.log)
.map_err(|e| format!("Failed to start network: {:?}", e))?;
self.network_globals = Some(network_globals);
@@ -249,7 +249,7 @@ where
.milliseconds_per_slot;
let _ = timer::spawn(
context.runtime_handle,
context.executor,
beacon_chain,
milliseconds_per_slot,
context.log.clone(),
@@ -290,7 +290,7 @@ where
let log = context.log.clone();
let listening_addr = rest_api::start_server(
context.runtime_handle,
context.executor,
&client_config.rest_api,
beacon_chain,
network_info,
@@ -332,7 +332,7 @@ where
.milliseconds_per_slot;
let _ = spawn_notifier(
context.runtime_handle,
context.executor,
beacon_chain,
network_globals,
milliseconds_per_slot,
@@ -428,7 +428,7 @@ where
let (sender, listening_addr): (WebSocketSender<TEthSpec>, Option<_>) = if config.enabled {
let (sender, listening_addr) =
websocket_server::start_server(context.runtime_handle, &config, &context.log)?;
websocket_server::start_server(context.executor, &config, &context.log)?;
(sender, Some(listening_addr))
} else {
(WebSocketSender::dummy(), None)
@@ -638,7 +638,7 @@ where
self.eth1_service = None;
// Starts the service that connects to an eth1 node and periodically updates caches.
backend.start(context.runtime_handle);
backend.start(context.executor);
self.beacon_chain_builder = Some(beacon_chain_builder.eth1_backend(Some(backend)));

View File

@@ -25,7 +25,7 @@ const SPEEDO_OBSERVATIONS: usize = 4;
/// Spawns a notifier service which periodically logs information about the node.
pub fn spawn_notifier<T: BeaconChainTypes>(
handle: environment::TaskExecutor,
executor: environment::TaskExecutor,
beacon_chain: Arc<BeaconChain<T>>,
network: Arc<NetworkGlobals<T::EthSpec>>,
milliseconds_per_slot: u64,
@@ -149,7 +149,7 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
};
// run the notifier on the current executor
handle.spawn(interval_future.unwrap_or_else(|_| ()), "beacon_notifier");
executor.spawn(interval_future.unwrap_or_else(|_| ()), "beacon_notifier");
Ok(())
}