mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-23 22:25:42 +00:00
chainhead backend: notify subscribers when the backend is closed (#1817)
* FollowEvent::stop include backend closed or not * simplify code: enum variant BackendClosed * check both stopped and backend closed * simplify hacky code * remove old test * Update subxt/src/backend/chain_head/follow_stream_driver.rs * Update subxt/src/backend/chain_head/mod.rs * Update subxt/src/backend/chain_head/mod.rs * Update subxt/src/backend/chain_head/follow_stream_driver.rs
This commit is contained in:
@@ -893,15 +893,7 @@ mod test {
|
||||
}
|
||||
|
||||
fn build_backend_spawn_background(rpc_client: impl RpcClientT) -> ChainHeadBackend<Conf> {
|
||||
let (backend, mut driver) = build_backend(rpc_client);
|
||||
tokio::spawn(async move {
|
||||
while let Some(val) = driver.next().await {
|
||||
if let Err(e) = val {
|
||||
eprintln!("Error driving unstable backend: {e}; terminating client");
|
||||
}
|
||||
}
|
||||
});
|
||||
backend
|
||||
ChainHeadBackend::builder().build_with_background_driver(rpc_client)
|
||||
}
|
||||
|
||||
fn runtime_spec() -> RuntimeSpec {
|
||||
|
||||
Reference in New Issue
Block a user