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

Copyright(c) Moritz Clasmeier 2017 2018
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.

setMaxUncommittedEvents :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set maximum number of uncommitted events in the provided value of consumption parameters.

setBatchLimit :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set batch limit in the provided value of consumption parameters.

setStreamLimit :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set stream limit in the provided value of consumption parameters.

setBatchFlushTimeout :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set batch-flush-timeout limit in the provided value of consumption parameters.

setStreamTimeout :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set stream timeout in the provided value of consumption parameters.

setStreamKeepAliveLimit :: Int32 -> ConsumeParameters -> ConsumeParameters Source #

Set stream-keep-alive-limit in the provided value of consumption parameters.

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

Set flow ID in the provided configuration.

defaultConsumeParameters :: ConsumeParameters Source #

Default parameters for event consumption.