[−][src]Struct nakadion::consumer::Consumer
Consumes an event stream
A consumer can be started to to consume a stream of events. To start it will consume itself and be returned once streaming has stopped so that it can be started again.
A consumer can be stopped internally and externally.
The consumer can be cloned so that that multiple connections to Nakadi
can be established. But be aware that in this case the consumers will share their
resources, e.g. the API client, metrics and logger.
Methods
impl Consumer
[src]
pub fn builder() -> Builder
[src]
Get an uninitialized Builder
.
pub fn builder_from_env() -> Result<Builder, Error>
[src]
Create a Builder
initialized with values from the environment
whereas the environment variables will be prefixed with NAKADION_
.
pub fn builder_from_env_prefixed<T: AsRef<str>>(
prefix: T
) -> Result<Builder, Error>
[src]
prefix: T
) -> Result<Builder, Error>
Create a Builder
initialized with values from the environment
whereas the environment variables will be prefixed with <prefix>_
.
pub fn start(self) -> (ConsumerHandle, Consuming)
[src]
Start consuming events.
A 'Consumingand a
ConsumerHandlewill be returned. The
Consumingwill complete with a
ConsumptionOutcomeonce consumption has stopped.
Consuming` can be dropped if ther is no interest in waiting the consumer
to finish.
The ConsumerHandle
can be used to check whether
the Consumer
is still running and to stop it.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Consumer
impl Send for Consumer
impl Sync for Consumer
impl Unpin for Consumer
impl !UnwindSafe for Consumer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,