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

Copyright(c) Moritz Clasmeier 2017 2018 2019
LicenseBSD3
Maintainermtesseract@silverratio.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Nakadi.Config

Description

This module implements support for creating and manipulating Nakadi client configurations.

Synopsis

Documentation

newConfig Source #

Arguments

:: Monad b 
=> HttpBackend b 
-> Request

Request Template

-> Config b

Resulting Configuration

Producs a new configuration, with mandatory HTTP manager, default consumption parameters and HTTP request template.

newConfigIO Source #

Arguments

:: Request

Request Template

-> ConfigIO

Resulting Configuration

Producs a new configuration, with mandatory HTTP manager, default consumption parameters and HTTP request template.

newConfigWithDedicatedManager Source #

Arguments

:: (MonadIO b, MonadMask b, MonadIO m) 
=> ManagerSettings

Optional ManagerSettings

-> Request

Request template for Nakadi requests

-> m (Config b)

Resulting Configuration

Produce a new configuration, with optional HTTP manager settings and mandatory HTTP request template.

setHttpManager :: Manager -> Config m -> Config m Source #

Install an HTTP Manager in the provided configuration. If not set, HTTP requests will use a global default manager.

setRequestModifier :: (Request -> m Request) -> Config m -> Config m Source #

Install a request modifier in the provided configuration. This can be used for e.g. including access tokens in HTTP requests to Nakadi.

setDeserializationFailureCallback :: (ByteString -> Text -> m ()) -> Config m -> Config m Source #

Install a callback in the provided configuration to use in case of deserialization failures when consuming events.

setStreamConnectCallback :: StreamConnectCallback m -> Config m -> Config m Source #

Install a callback in the provided configuration which is used after having successfully established a streaming Nakadi connection.

setHttpErrorCallback :: HttpErrorCallback m -> Config m -> Config m Source #

Install a callback in the provided configuration which is called on HTTP 5xx errors. This allows the user to act on such error conditions by e.g. logging errors or updating metrics. Note that this callback is called synchronously, thus blocking in this callback delays potential retry attempts.

setLogFunc :: LogFunc m -> Config m -> Config m Source #

Install a logger callback in the provided configuration.

setRetryPolicy :: RetryPolicyM IO -> Config m -> Config m Source #

Set a custom retry policy in the provided configuration.

setWorkerThreads :: Int -> Config m -> Config m Source #

Set number of worker threads that should be spawned on subscription consumption. The (per event-type) partitions of the subscription to be consumed will then be mapped onto this finite set of workers.

setMaxUncommittedEvents :: Int32 -> Config m -> Config m Source #

Set maximum number of uncommitted events.

setBatchLimit :: Int32 -> Config m -> Config m Source #

Set batch limit.

setStreamLimit :: Int32 -> Config m -> Config m Source #

Set stream limit.

setBatchFlushTimeout :: Int32 -> Config m -> Config m Source #

Set batch-flush-timeout limit.

setStreamTimeout :: Int32 -> Config m -> Config m Source #

Set stream timeout.

setStreamKeepAliveLimit :: Int32 -> Config m -> Config m Source #

Set stream-keep-alive-limit.

setFlowId :: FlowId -> Config m -> Config m Source #

Set flow ID in the provided configuration.

setCommitStrategy :: CommitStrategy -> Config m -> Config m Source #

Set flow ID in the provided configuration.