LiveClient::reconnect

Closes the current connection, then reopens the connection and authenticates with the live gateway.

API method
async fn reconnect(&mut self) -> crate::Result<()>;
Example usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use databento::{
    LiveClient,
    dbn::{Dataset::IfeuImpact, SType, Schema},
    live::Subscription,
};

let mut client = LiveClient::builder()
    .key("$YOUR_API_KEY")?
    .dataset(IfeuImpact)
    .build()
    .await?;
// Close the connection
client.close().await?;
// Reopen the connection
client.reconnect().await?;