Skip to content

Commit

Permalink
Remove unnecessary RPC boxing (paritytech#11434)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc authored May 17, 2022
1 parent 88abf20 commit f2c9c51
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
6 changes: 2 additions & 4 deletions client/beefy/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ where
if let Some(mut sink) = pending.accept() {
sink.pipe_from_stream(stream).await;
}
}
.boxed();
};

self.executor
.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}

async fn latest_finalized(&self) -> RpcResult<Block::Hash> {
Expand Down
6 changes: 2 additions & 4 deletions client/finality-grandpa/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,9 @@ where
if let Some(mut sink) = pending.accept() {
sink.pipe_from_stream(stream).await;
}
}
.boxed();
};

self.executor
.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}

async fn prove_finality(
Expand Down
6 changes: 2 additions & 4 deletions client/rpc/src/author/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@ where
};

sink.pipe_from_stream(stream).await;
}
.boxed();
};

self.executor
.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}
}
5 changes: 2 additions & 3 deletions client/rpc/src/chain/chain_full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ fn subscribe_headers<Block, Client, F, G, S>(
if let Some(mut sink) = pending.accept() {
sink.pipe_from_stream(stream).await;
}
}
.boxed();
};

executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}
12 changes: 4 additions & 8 deletions client/rpc/src/state/state_full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,9 @@ where
if let Some(mut sink) = pending.accept() {
sink.pipe_from_stream(stream).await;
}
}
.boxed();
};

self.executor
.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}

fn subscribe_storage(&self, pending: PendingSubscription, keys: Option<Vec<StorageKey>>) {
Expand Down Expand Up @@ -451,11 +449,9 @@ where
if let Some(mut sink) = pending.accept() {
sink.pipe_from_stream(stream).await;
}
}
.boxed();
};

self.executor
.spawn("substrate-rpc-subscription", Some("rpc"), fut.map(drop).boxed());
self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed());
}

async fn trace_block(
Expand Down

0 comments on commit f2c9c51

Please sign in to comment.