Struct tokio_nsq::NSQConfigShared
source · pub struct NSQConfigShared { /* private fields */ }
Expand description
Configuration options shared by both produces and consumers
Implementations§
sourcepub fn set_backoff_max_wait(self, duration: Duration) -> Self
pub fn set_backoff_max_wait(self, duration: Duration) -> Self
The maximum reconnect backoff wait. Defaults to 60 seconds.
sourcepub fn set_backoff_healthy_after(self, duration: Duration) -> Self
pub fn set_backoff_healthy_after(self, duration: Duration) -> Self
How long a connection should be healthy before backoff is reset. Defaults to 45 seconds.
sourcepub fn set_compression(self, compression: NSQConfigSharedCompression) -> Self
pub fn set_compression(self, compression: NSQConfigSharedCompression) -> Self
Connection compression options. Defaults to no compression.
sourcepub fn set_credentials(self, credentials: Vec<u8>) -> Self
pub fn set_credentials(self, credentials: Vec<u8>) -> Self
Credentials to send NSQD if authentication is requried. Defaults to no credentials.
sourcepub fn set_tls(self, tls: NSQConfigSharedTLS) -> Self
pub fn set_tls(self, tls: NSQConfigSharedTLS) -> Self
Connection encryption options. Defaults to no encryption
sourcepub fn set_client_id<S: Into<String>>(self, client_id: S) -> Self
pub fn set_client_id<S: Into<String>>(self, client_id: S) -> Self
A string used to identify an NSQ client. Defaults to anonymous identity.
sourcepub fn set_write_timeout(self, duration: Option<Duration>) -> Self
pub fn set_write_timeout(self, duration: Option<Duration>) -> Self
Timeout for socket write operations. Defaults to 10 seconds.
Setting the duration to None
disables write timeouts.
sourcepub fn set_read_timeout(self, duration: Option<Duration>) -> Self
pub fn set_read_timeout(self, duration: Option<Duration>) -> Self
Timeout for socket read operations. Defaults to 60 seconds. Must be
greater than the heartbeat interval. Setting the duration to None
disables read timeouts.
sourcepub fn set_hostname<S: Into<String>>(self, hostname: S) -> Self
pub fn set_hostname<S: Into<String>>(self, hostname: S) -> Self
The hostname sent to NSQD. Defaults to the hostname provided by the operating system.
sourcepub fn set_user_agent<S: Into<String>>(self, user_agent: S) -> Self
pub fn set_user_agent<S: Into<String>>(self, user_agent: S) -> Self
The user agent sent to NSQD. Defaults to “tokio_nsq/package_version”.
sourcepub fn set_flush_interval(self, duration: Duration) -> Self
pub fn set_flush_interval(self, duration: Duration) -> Self
How often the TCP write buffer should be flushed. An outgoing write buffer substantially increases network performance, particularly in the context of compression. Defaults to every 250 milliseconds.
Trait Implementations§
source§fn clone(&self) -> NSQConfigShared
fn clone(&self) -> NSQConfigShared
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more