Module documentation for 0.5.0.3
Please note that the API is not considered stable yet.
Docker based test suite testing against the official Nakadi docker image.
A type-safe API for interacting with Nakadi. For example, the name of an event type has type
Textor something generic. Correct types for values like
CursorOffsetare provided (which must be treated as opaque strings).
Integrated and configurable retry mechanism.
Conduit based interfaces for streaming events.
Support for temporary subscriptions.
Convenient Subscription API interface (
subscriptionProcessConduit), which frees the user from any manual bookkeeping.
Mechanism for registering callbacks for logging and token injection.
Example code showing how to dump a subscription:
dumpSubscription :: (MonadLogger m, MonadNakadi IO m) => Nakadi.SubscriptionId -> m () dumpSubscription subscriptionId = Nakadi.subscriptionProcess Nothing subscriptionId processBatch where processBatch :: MonadLogger m => Nakadi.SubscriptionEventStreamBatch Value -> m () processBatch batch = logInfoN (tshow batch)
Nakadi-Client Change Log
Nakadi business events are supported.
Support for concurrent workers consuming a subscription. This feature is activated using the function
The modelling of the subscription API has been simplified by by differentiating between
SubscriptionRequest(before creation) and
An experimental API for creating a Conduit event source for a given subscription is included, allowing simulating the old low-level API using the Subscription API.
A new function
withSubscriptionis included, providing an interface for creating a subscription and automatically passing its subscription ID to some user-provided action.
A new function
withTemporarySubscriptionis included, which is very similar to
withSubscription, but with the crucicial difference that the subscription will be automatically deleted after the user-provided action has terminated.
Support for the new
show_time_lagfield when retrieving subscription statistics has been added.
MonadNakadiinstance for the
IOmonad using a global Nakadi configuration has been added. The new module
Network.Nakadi.Unsafe.IOexposes functionality for accessing this global Nakadi configuration. The new instance for
IOallows e.g. the evaluation of Nakadi calls interactively in GHCi without the need to run any monad transformers.
A new convenience function
newConfigFromEnvis exposed, which allows creating a Nakadi configuration with the Nakadi service URL being derived automatically from the environment variable