Struct nakadion::Nakadion
[−]
[src]
pub struct Nakadion { /* fields omitted */ }
This struct represents Nakadion.
Once instatntiated it can only be used query its running state or to stop consuming events.
Methods
impl Nakadion
[src]
pub fn start_with<HF, C, A, M>(
subscription_id: SubscriptionId,
streaming_client: C,
api_client: A,
handler_factory: HF,
commit_strategy: CommitStrategy,
metrics_collector: M,
min_idle_worker_lifetime: Option<Duration>
) -> Result<Nakadion, Error> where
C: StreamingClient + Clone + Sync + Send + 'static,
A: ApiClient + Clone + Sync + Send + 'static,
HF: HandlerFactory + Sync + Send + 'static,
M: MetricsCollector + Clone + Send + Sync + 'static,
[src]
subscription_id: SubscriptionId,
streaming_client: C,
api_client: A,
handler_factory: HF,
commit_strategy: CommitStrategy,
metrics_collector: M,
min_idle_worker_lifetime: Option<Duration>
) -> Result<Nakadion, Error> where
C: StreamingClient + Clone + Sync + Send + 'static,
A: ApiClient + Clone + Sync + Send + 'static,
HF: HandlerFactory + Sync + Send + 'static,
M: MetricsCollector + Clone + Send + Sync + 'static,
Start with manually created components and parameter
The SubscriptionId
must be already known
Errors
Nakadion could not be started.
pub fn start<HF, P, M>(
config: NakadionConfig,
handler_factory: HF,
access_token_provider: P,
metrics_collector: M
) -> Result<Nakadion, Error> where
HF: HandlerFactory + Sync + Send + 'static,
P: ProvidesAccessToken + Send + Sync + 'static,
M: MetricsCollector + Clone + Send + Sync + 'static,
[src]
config: NakadionConfig,
handler_factory: HF,
access_token_provider: P,
metrics_collector: M
) -> Result<Nakadion, Error> where
HF: HandlerFactory + Sync + Send + 'static,
P: ProvidesAccessToken + Send + Sync + 'static,
M: MetricsCollector + Clone + Send + Sync + 'static,
Start with the given configuration and create all interally required components from the configuration
Errors
Nakadion could not be started. This might be due to an invalid configuration
pub fn running(&self) -> bool
[src]
Returns true if Nakadion is running
pub fn stop(&self)
[src]
Stops Nakadion
pub fn block_until_stopped(&self)
[src]
Block the current thread until Nakadion has stopped
pub fn block_until_stopped_with_interval(&self, poll_interval: Duration)
[src]
Block the current thread until Nakadion has stopped.
The state is polled at the given poll_interval
.