Skip to content

Commit

Permalink
ADD: Add heartbeat interval getter
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Jun 7, 2024
1 parent 8740932 commit 293fd46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 0.11.1 - TBD

#### Enhancements
- Added getter for `heartbeat_interval` to `LiveClient`

#### Bug fixes
- Fixed potential incorrect DNS resolution when overriding the live gateway address
with `live::Builder::addr`
Expand Down
8 changes: 8 additions & 0 deletions src/live/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Client {
dataset: String,
send_ts_out: bool,
upgrade_policy: VersionUpgradePolicy,
heartbeat_interval: Option<Duration>,
connection: WriteHalf<TcpStream>,
decoder: AsyncRecordDecoder<BufReader<ReadHalf<TcpStream>>>,
session_id: String,
Expand Down Expand Up @@ -98,6 +99,7 @@ impl Client {
dataset,
send_ts_out,
upgrade_policy,
heartbeat_interval,
connection: writer,
// Pass a placeholder DBN version and should never fail because DBN_VERSION
// is a valid DBN version. Correct version set in `start()`.
Expand Down Expand Up @@ -138,6 +140,11 @@ impl Client {
self.upgrade_policy
}

/// Returns the heartbeat interval override if there is one, otherwise `None`.
pub fn heartbeat_interval(&self) -> Option<Duration> {
self.heartbeat_interval
}

fn determine_gateway(dataset: &str) -> String {
const DEFAULT_PORT: u16 = 13_000;

Expand Down Expand Up @@ -350,6 +357,7 @@ impl fmt::Debug for Client {
.field("dataset", &self.dataset)
.field("send_ts_out", &self.send_ts_out)
.field("upgrade_policy", &self.upgrade_policy)
.field("heartbeat_interval", &self.heartbeat_interval)
.field("session_id", &self.session_id)
.finish_non_exhaustive()
}
Expand Down

0 comments on commit 293fd46

Please sign in to comment.