nakadi-client-0.6.1.0: Client library for the Nakadi Event Broker

Copyright(c) Moritz Clasmeier 2017 2018
LicenseBSD3
Maintainermtesseract@silverratio.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Nakadi.Subscriptions.Events

Description

This module implements a high level interface for the /subscriptions/SUBSCRIPTIONS/events API.

Synopsis

Documentation

subscriptionProcessConduit Source #

Arguments

:: (MonadNakadi b m, MonadUnliftIO m, MonadResource m, MonadMask m, FromJSON a, batch ~ SubscriptionEventStreamBatch a) 
=> SubscriptionId

Subscription to consume

-> ConduitM batch batch m ()

Conduit processor.

-> m () 

Conduit based interface for subscription consumption. Consumes the specified subscription using the commit strategy contained in the configuration. Each consumed event batch is then processed by the provided conduit. If an exception is thrown inside the conduit, subscription consumption will terminate.

subscriptionProcess Source #

Arguments

:: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) 
=> SubscriptionId

Subscription to consume

-> (SubscriptionEventStreamBatch a -> m ())

Batch processor action

-> m () 

Consumes the specified subscription using the commit strategy contained in the configuration. Each consumed batch of subscription events is provided to the provided batch processor action. If this action throws an exception, subscription consumption will terminate.

subscriptionSource Source #

Arguments

:: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) 
=> SubscriptionId

Subscription to consume.

-> ConduitM () (SubscriptionEventStreamBatch a) m ()

Conduit source.

Experimental API.

Creates a Conduit source from a subscription ID. The source will produce subscription event stream batches. Note the batches will be asynchronously committed irregardless of any event processing logic. Use this function only if the guarantees provided by Nakadi for event processing and cursor committing are not required or not desired.

subscriptionSourceEvents Source #

Arguments

:: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) 
=> SubscriptionId

Subscription to consume

-> ConduitM () a m ()

Conduit processor.

Experimental API.

Similar to subscriptionSource, but the created Conduit source provides events instead of event batches.