Copyright | (c) Moritz Schulte 2017 |
---|---|
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.
- subscriptionSource :: (MonadNakadi m, MonadResource m, MonadBaseControl IO m, MonadMask m, FromJSON a) => Config -> Maybe ConsumeParameters -> SubscriptionId -> m (SubscriptionEventStream, ConduitM () (SubscriptionEventStreamBatch a) (ReaderT SubscriptionEventStreamContext m) ())
- subscriptionSourceR :: (MonadNakadiEnv r m, MonadResource m, MonadBaseControl IO m, MonadMask m, FromJSON a) => Maybe ConsumeParameters -> SubscriptionId -> m (SubscriptionEventStream, ConduitM () (SubscriptionEventStreamBatch a) (ReaderT SubscriptionEventStreamContext m) ())
- runSubscription :: (Monad m, MonadBaseControl IO m, MonadResource m) => Config -> SubscriptionEventStream -> ConduitM () Void (ReaderT SubscriptionEventStreamContext m) r -> m r
- runSubscriptionR :: (Monad m, MonadBaseControl IO m, MonadResource m, MonadReader r m, HasNakadiConfig r Config) => SubscriptionEventStream -> ConduitM () Void (ReaderT SubscriptionEventStreamContext m) r -> m r
- subscriptionSink :: (MonadNakadi m, HasNakadiSubscriptionCursor a) => ConduitM a Void (ReaderT SubscriptionEventStreamContext m) ()
Documentation
:: (MonadNakadi m, MonadResource m, MonadBaseControl IO m, MonadMask m, FromJSON a) | |
=> Config | Configuration |
-> Maybe ConsumeParameters | Optional Consumption Parameters |
-> SubscriptionId | Subscription ID |
-> m (SubscriptionEventStream, ConduitM () (SubscriptionEventStreamBatch a) (ReaderT SubscriptionEventStreamContext m) ()) | Returns a Pair consisting of subscription
connection information ( |
GET to /subscriptions/SUBSCRIPTION/events
. Creates a Conduit
Source producing events from a Subscription's event stream.
:: (MonadNakadiEnv r m, MonadResource m, MonadBaseControl IO m, MonadMask m, FromJSON a) | |
=> Maybe ConsumeParameters | Optional Consumption Parameters |
-> SubscriptionId | Subscription ID |
-> m (SubscriptionEventStream, ConduitM () (SubscriptionEventStreamBatch a) (ReaderT SubscriptionEventStreamContext m) ()) | Returns a Pair consisting of subscription
connection information ( |
GET to /subscriptions/SUBSCRIPTION/events
. Creates a Conduit
Source producing events from a Subscription's event stream. Uses
the configuration from the environment.
:: (Monad m, MonadBaseControl IO m, MonadResource m) | |
=> Config | Configuration |
-> SubscriptionEventStream | Connection information for the Subscription |
-> ConduitM () Void (ReaderT SubscriptionEventStreamContext m) r | Subscription Conduit to run |
-> m r | Result of the Conduit |
Run a Subscription processing Conduit.
:: (Monad m, MonadBaseControl IO m, MonadResource m, MonadReader r m, HasNakadiConfig r Config) | |
=> SubscriptionEventStream | Connection information for the Subscription |
-> ConduitM () Void (ReaderT SubscriptionEventStreamContext m) r | Subscription Conduit to run |
-> m r | Result of the Conduit |
Run a Subscription processing Conduit. Uses the configuration contained in the environment.
subscriptionSink :: (MonadNakadi m, HasNakadiSubscriptionCursor a) => ConduitM a Void (ReaderT SubscriptionEventStreamContext m) () Source #
Sink which can be used as sink for Conduits processing subscriptions events. This sink takes care of committing events. It can consume any values which contain Subscription Cursors.