Copyright | (c) Moritz Clasmeier 2017 2018 2019 |
---|---|
License | BSD3 |
Maintainer | mtesseract@silverratio.net |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module implements support for creating and manipulating Nakadi client configurations.
Synopsis
- newConfig :: Monad b => HttpBackend b -> Request -> Config b
- newConfigIO :: Request -> ConfigIO
- newConfigWithDedicatedManager :: (MonadIO b, MonadMask b, MonadIO m) => ManagerSettings -> Request -> m (Config b)
- newConfigFromEnv :: (MonadIO m, MonadThrow m, MonadMask b, MonadIO b) => m (Config b)
- setHttpManager :: Manager -> Config m -> Config m
- setRequestModifier :: (Request -> m Request) -> Config m -> Config m
- setDeserializationFailureCallback :: (ByteString -> Text -> m ()) -> Config m -> Config m
- setStreamConnectCallback :: StreamConnectCallback m -> Config m -> Config m
- setHttpErrorCallback :: HttpErrorCallback m -> Config m -> Config m
- setLogFunc :: LogFunc m -> Config m -> Config m
- setRetryPolicy :: RetryPolicyM IO -> Config m -> Config m
- setWorkerThreads :: Int -> Config m -> Config m
- setMaxUncommittedEvents :: Int32 -> Config m -> Config m
- setBatchLimit :: Int32 -> Config m -> Config m
- setStreamLimit :: Int32 -> Config m -> Config m
- setBatchFlushTimeout :: Int32 -> Config m -> Config m
- setStreamTimeout :: Int32 -> Config m -> Config m
- setStreamKeepAliveLimit :: Int32 -> Config m -> Config m
- setFlowId :: FlowId -> Config m -> Config m
- setCommitStrategy :: CommitStrategy -> Config m -> Config m
- setCommitTimeout :: CommitTimeout -> Config m -> Config m
- setShowTimeLag :: Bool -> Config m -> Config m
Documentation
:: 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.
Producs a new configuration, with mandatory HTTP manager, default consumption parameters and HTTP request template.
newConfigWithDedicatedManager Source #
:: (MonadIO b, MonadMask b, MonadIO m) | |
=> ManagerSettings | Optional |
-> 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.
newConfigFromEnv :: (MonadIO m, MonadThrow m, MonadMask b, MonadIO b) => m (Config b) Source #
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.
setCommitStrategy :: CommitStrategy -> Config m -> Config m Source #
Set flow ID in the provided configuration.
setCommitTimeout :: CommitTimeout -> Config m -> Config m Source #