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