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

Copyright(c) Moritz Schulte 2017
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

subscriptionSource Source #

Arguments

:: (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 (SubscriptionEventStream) and a Conduit source.

GET to /subscriptions/SUBSCRIPTION/events. Creates a Conduit Source producing events from a Subscription's event stream.

subscriptionSourceR Source #

Arguments

:: (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 (SubscriptionEventStream) and a Conduit source.

GET to /subscriptions/SUBSCRIPTION/events. Creates a Conduit Source producing events from a Subscription's event stream. Uses the configuration from the environment.

runSubscription Source #

Arguments

:: (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.

runSubscriptionR Source #

Arguments

:: (Monad m, MonadBaseControl IO m, MonadResource m, MonadReader r m, HasNakadiConfig r Config) 
=> SubscriptionEventStream

Connection information for the Subscription

-> ConduitM () Void (ReaderT SubscriptionEventStreamContext m) s

Subscription Conduit to run

-> m s

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.