mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: don't box some futures (#6728)
This commit is contained in:
@ -184,7 +184,7 @@ impl Command {
|
||||
let (payload_service, payload_builder): (_, PayloadBuilderHandle<EthEngineTypes>) =
|
||||
PayloadBuilderService::new(payload_generator, blockchain_db.canonical_state_stream());
|
||||
|
||||
ctx.task_executor.spawn_critical("payload builder service", Box::pin(payload_service));
|
||||
ctx.task_executor.spawn_critical("payload builder service", payload_service);
|
||||
|
||||
// Configure the consensus engine
|
||||
let network_client = network.fetch_client().await?;
|
||||
|
||||
@ -81,7 +81,7 @@ where
|
||||
let eth_filter = Self { inner: Arc::new(inner) };
|
||||
|
||||
let this = eth_filter.clone();
|
||||
eth_filter.inner.task_spawner.clone().spawn_critical(
|
||||
eth_filter.inner.task_spawner.spawn_critical(
|
||||
"eth-filters_stale-filters-clean",
|
||||
Box::pin(async move {
|
||||
this.watch_and_clear_stale_filters().await;
|
||||
|
||||
@ -656,10 +656,7 @@ mod tests {
|
||||
let manager = TaskManager::new(handle);
|
||||
let executor = manager.executor();
|
||||
|
||||
executor.spawn_critical(
|
||||
"this is a critical task",
|
||||
Box::pin(async { panic!("intentionally panic") }),
|
||||
);
|
||||
executor.spawn_critical("this is a critical task", async { panic!("intentionally panic") });
|
||||
|
||||
runtime.block_on(async move {
|
||||
let err = manager.await;
|
||||
@ -678,13 +675,10 @@ mod tests {
|
||||
|
||||
let (signal, shutdown) = signal();
|
||||
|
||||
executor.spawn_critical(
|
||||
"this is a critical task",
|
||||
Box::pin(async move {
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
drop(signal);
|
||||
}),
|
||||
);
|
||||
executor.spawn_critical("this is a critical task", async move {
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
drop(signal);
|
||||
});
|
||||
|
||||
drop(manager);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user