mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 23:21:02 +00:00
When restarting client, also "restart" tokio runtime (#1065)
* remember new tokio runtime on reconnect * compilation
This commit is contained in:
committed by
Bastian Köcher
parent
63d6fc436a
commit
09d30894d1
@@ -76,7 +76,9 @@ impl Client {
|
|||||||
|
|
||||||
/// Reopen client connection.
|
/// Reopen client connection.
|
||||||
pub async fn reconnect(&mut self) -> Result<()> {
|
pub async fn reconnect(&mut self) -> Result<()> {
|
||||||
self.client = Self::build_client(&self.params).await?.1;
|
let (tokio, client) = Self::build_client(&self.params).await?;
|
||||||
|
self.tokio = tokio;
|
||||||
|
self.client = client;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,9 @@ impl<C: Chain> Client<C> {
|
|||||||
|
|
||||||
/// Reopen client connection.
|
/// Reopen client connection.
|
||||||
pub async fn reconnect(&mut self) -> Result<()> {
|
pub async fn reconnect(&mut self) -> Result<()> {
|
||||||
self.client = Self::build_client(self.params.clone()).await?.1;
|
let (tokio, client) = Self::build_client(self.params.clone()).await?;
|
||||||
|
self.tokio = tokio;
|
||||||
|
self.client = client;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user