Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
krojew committed Jul 3, 2023
1 parent e1bc7c5 commit 153912a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [4.2.0]

### Fixed

- Leak when reconnecting (by tsxiaofang).

### Changed

- Trying to reconnect when failed to parse connect response (by tsxiaofang).

### New

-`connect_with_retry_time()` function for specifying retry timeout.

## [4.1.1]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zookeeper-async"
version = "4.1.1"
version = "4.2.0"
authors = ["Kamil Rojewski <[email protected]>", "Nandor Kracser <[email protected]>"]
license = "MIT"
homepage = "https://github.com/krojew/rust-zookeeper"
Expand Down
8 changes: 5 additions & 3 deletions src/zookeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ impl ZooKeeper {
/// - `timeout`: session timeout -- how long should a client go without receiving communication
/// from a server before considering it connection loss?
/// - `watcher`: a watcher object to be notified of connection state changes.
/// - `retry_time`: when the connection is lost, reconnect for a longer time to avoid reconnecting too quickly
pub async fn connect_with<W>(
/// - `retry_time`: when the connection is lost, reconnect for a longer time to avoid
/// reconnecting too quickly
pub async fn connect_with_retry_time<W>(
connect_string: &str,
timeout: Duration,
watcher: W,
Expand Down Expand Up @@ -111,7 +112,8 @@ impl ZooKeeper {
where
W: Watcher + 'static,
{
Self::connect_with(connect_string, timeout, watcher, Duration::from_secs(0)).await
Self::connect_with_retry_time(connect_string, timeout, watcher, Duration::from_secs(0))
.await
}

fn parse_connect_string(connect_string: &str) -> ZkResult<(Vec<SocketAddr>, Option<String>)> {
Expand Down

0 comments on commit 153912a

Please sign in to comment.