From 452ee50d02ade2358ba6bce9917add38bd0bd8cd Mon Sep 17 00:00:00 2001 From: stevencartavia <112043913+stevencartavia@users.noreply.github.com> Date: Wed, 21 May 2025 02:24:42 -0600 Subject: [PATCH] chore: Move subscription_task_spawner into EthPubSubInner (#16383) --- crates/rpc/rpc/src/eth/pubsub.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/rpc/rpc/src/eth/pubsub.rs b/crates/rpc/rpc/src/eth/pubsub.rs index 2baf842d63..4ddcd35d78 100644 --- a/crates/rpc/rpc/src/eth/pubsub.rs +++ b/crates/rpc/rpc/src/eth/pubsub.rs @@ -36,8 +36,6 @@ use tracing::error; pub struct EthPubSub { /// All nested fields bundled together. inner: Arc>, - /// The type that's used to spawn subscription tasks. - subscription_task_spawner: Box, } // === impl EthPubSub === @@ -52,8 +50,8 @@ impl EthPubSub { /// Creates a new, shareable instance. pub fn with_spawner(eth_api: Eth, subscription_task_spawner: Box) -> Self { - let inner = EthPubSubInner { eth_api }; - Self { inner: Arc::new(inner), subscription_task_spawner } + let inner = EthPubSubInner { eth_api, subscription_task_spawner }; + Self { inner: Arc::new(inner) } } } @@ -76,7 +74,7 @@ where ) -> jsonrpsee::core::SubscriptionResult { let sink = pending.accept().await?; let pubsub = self.inner.clone(); - self.subscription_task_spawner.spawn(Box::pin(async move { + self.inner.subscription_task_spawner.spawn(Box::pin(async move { let _ = handle_accepted(pubsub, sink, kind, params).await; })); @@ -262,6 +260,8 @@ impl std::fmt::Debug for EthPubSub { struct EthPubSubInner { /// The `eth` API. eth_api: EthApi, + /// The type that's used to spawn subscription tasks. + subscription_task_spawner: Box, } // == impl EthPubSubInner ===