Struct nakadion::ConnectorSettingsBuilder
[−]
[src]
pub struct ConnectorSettingsBuilder { pub stream_keep_alive_limit: Option<usize>, pub stream_limit: Option<usize>, pub stream_timeout: Option<Duration>, pub batch_flush_timeout: Option<Duration>, pub batch_limit: Option<usize>, pub max_uncommitted_events: Option<usize>, pub nakadi_host: Option<Url>, }
Builder for ConnectorSettings
.
Fields
stream_keep_alive_limit: Option<usize>
Maximum number of empty keep alive batches to get in a row before closing the connection. If 0 or undefined will send keep alive messages indefinitely.
stream_limit: Option<usize>
Maximum number of Event
s in this stream (over all partitions being streamed in this
connection).
- If 0 or undefined, will stream batches indefinitely.
- Stream initialization will fail if
stream_limit
is lower thanbatch_limit
.
stream_timeout: Option<Duration>
Maximum time in seconds a stream will live before connection is closed by the server.
If 0 or unspecified will stream indefinitely.
If this timeout is reached, any pending messages (in the sense of stream_limit
)
will be flushed to the client.
Stream initialization will fail if stream_timeout
is lower than batch_flush_timeout
.
batch_flush_timeout: Option<Duration>
Maximum time in seconds to wait for the flushing of each chunk (per partition).
- If the amount of buffered Events reaches
batch_limit
before thisbatch_flush_timeout
is reached, the messages are immediately flushed to the client and batch flush timer is reset. - If 0 or undefined, will assume 30 seconds.
batch_limit: Option<usize>
Maximum number of Event
s in each chunk (and therefore per partition) of the stream.
- If 0 or unspecified will buffer Events indefinitely and flush on reaching of
batch_flush_timeout
.
max_uncommitted_events: Option<usize>
The amount of uncommitted events Nakadi will stream before pausing the stream. When in paused state and commit comes - the stream will resume. Minimal value is 1.
nakadi_host: Option<Url>
The URI prefix for the Nakadi Host, e.g. "https://my.nakadi.com"
Methods
impl ConnectorSettingsBuilder
[src]
fn stream_keep_alive_limit(self, value: usize) -> Self
Maximum number of empty keep alive batches to get in a row before closing the connection. If 0 or undefined will send keep alive messages indefinitely.
fn stream_limit(self, value: usize) -> Self
Maximum number of Event
s in this stream (over all partitions being streamed in this
connection).
- If 0 or undefined, will stream batches indefinitely.
- Stream initialization will fail if
stream_limit
is lower thanbatch_limit
.
fn stream_timeout(self, value: Duration) -> Self
Maximum time in seconds a stream will live before connection is closed by the server.
If 0 or unspecified will stream indefinitely.
If this timeout is reached, any pending messages (in the sense of stream_limit
)
will be flushed to the client.
Stream initialization will fail if stream_timeout
is lower than batch_flush_timeout
.
fn batch_flush_timeout(self, value: Duration) -> Self
Maximum time in seconds to wait for the flushing of each chunk (per partition).
- If the amount of buffered Events reaches
batch_limit
before thisbatch_flush_timeout
is reached, the messages are immediately flushed to the client and batch flush timer is reset. - If 0 or undefined, will assume 30 seconds.
fn batch_limit(self, value: usize) -> Self
Maximum number of Event
s in each chunk (and therefore per partition) of the stream.
- If 0 or unspecified will buffer Events indefinitely and flush on reaching of
batch_flush_timeout
.
fn max_uncommitted_events(self, value: usize) -> Self
The amount of uncommitted events Nakadi will stream before pausing the stream. When in paused state and commit comes - the stream will resume. Minimal value is 1.
fn nakadi_host(self, value: Url) -> Self
The URI prefix for the Nakadi Host, e.g. "https://my.nakadi.com"
fn build(self) -> Result<ConnectorSettings, String>
impl ConnectorSettingsBuilder
[src]
fn from_env() -> Result<ConnectorSettingsBuilder, String>
Create a builder from environment variables.
For variables not found except 'NAKADION_NAKADI_HOST' a default will be set.
Variables:
- NAKADION_NAKADI_HOST: See
ConnectorSettings::nakadi_host
- NAKADION_MAX_UNCOMMITED_EVENTS: See
ConnectorSettings::max_uncommitted_events
- NAKADION_BATCH_LIMIT: See
ConnectorSettings::batch_limit
- NAKADION_BATCH_FLUSH_TIMEOUT_SECS: See
ConnectorSettings::batch_flush_timeout
- NAKADION_STREAM_TIMEOUT_SECS: See
ConnectorSettings::stream_timeout
- NAKADION_STREAM_LIMIT: See
ConnectorSettings::stream_limit
- NAKADION_STREAM_KEEP_ALIVE_LIMIT: See
ConnectorSettings::stream_keep_alive_limit
Trait Implementations
impl Default for ConnectorSettingsBuilder
[src]
fn default() -> ConnectorSettingsBuilder
Returns the "default value" for a type. Read more
impl Clone for ConnectorSettingsBuilder
[src]
fn clone(&self) -> ConnectorSettingsBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more