Struct tokio_zookeeper::ZooKeeperBuilder
source · pub struct ZooKeeperBuilder { /* private fields */ }
Expand description
Builder that allows customizing options for ZooKeeper connections.
Implementations§
source§impl ZooKeeperBuilder
impl ZooKeeperBuilder
sourcepub fn connect(
self,
addr: &SocketAddr
) -> impl Future<Item = (ZooKeeper, impl Stream<Item = WatchedEvent, Error = ()>), Error = Error>
pub fn connect(
self,
addr: &SocketAddr
) -> impl Future<Item = (ZooKeeper, impl Stream<Item = WatchedEvent, Error = ()>), Error = Error>
Connect to a ZooKeeper server instance at the given address.
Session establishment is asynchronous. This constructor will initiate connection to the
server and return immediately - potentially (usually) before the session is fully
established. When the session is established, a ZooKeeper
instance is returned, along
with a “watcher” that will provide notifications of any changes in state.
If the connection to the server fails, the client will automatically try to re-connect. Only if re-connection fails is an error returned to the client. Requests that are in-flight during a disconnect may fail and have to be retried.
sourcepub fn set_timeout(&mut self, t: Duration)
pub fn set_timeout(&mut self, t: Duration)
Set the ZooKeeper session expiry timeout.
The default timeout is dictated by the server.
sourcepub fn set_logger(&mut self, l: Logger)
pub fn set_logger(&mut self, l: Logger)
Set the logger that should be used internally in the ZooKeeper client.
By default, all logging is disabled. See also the slog
documentation.
Trait Implementations§
source§impl Clone for ZooKeeperBuilder
impl Clone for ZooKeeperBuilder
source§fn clone(&self) -> ZooKeeperBuilder
fn clone(&self) -> ZooKeeperBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more