Copyright | (c) Moritz Clasmeier 2017 2018 |
---|---|
License | BSD3 |
Maintainer | mtesseract@silverratio.net |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Network.Nakadi.Subscriptions.Events
Description
This module implements a high level interface for the
/subscriptions/SUBSCRIPTIONS/events
API.
Synopsis
- subscriptionProcessConduit :: (MonadNakadi b m, MonadUnliftIO m, MonadResource m, MonadMask m, FromJSON a, batch ~ SubscriptionEventStreamBatch a) => SubscriptionId -> ConduitM batch batch m () -> m ()
- subscriptionProcess :: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) => SubscriptionId -> (SubscriptionEventStreamBatch a -> m ()) -> m ()
- subscriptionSource :: forall a b m. (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) => SubscriptionId -> ConduitM () (SubscriptionEventStreamBatch a) m ()
- subscriptionSourceEvents :: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, MonadResource m, FromJSON a) => SubscriptionId -> ConduitM () a m ()
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.
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.
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.