Copyright | (c) Moritz Clasmeier 2017 2018 |
---|---|
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.
- newConfig :: Monad b => HttpBackend b -> Request -> Config b
- newConfigIO :: Request -> ConfigIO
- newConfigWithDedicatedManager :: (MonadIO b, MonadMask b, MonadIO m) => ManagerSettings -> Request -> 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
- setMaxUncommittedEvents :: Int32 -> ConsumeParameters -> ConsumeParameters
- setBatchLimit :: Int32 -> ConsumeParameters -> ConsumeParameters
- setStreamLimit :: Int32 -> ConsumeParameters -> ConsumeParameters
- setBatchFlushTimeout :: Int32 -> ConsumeParameters -> ConsumeParameters
- setStreamTimeout :: Int32 -> ConsumeParameters -> ConsumeParameters
- setStreamKeepAliveLimit :: Int32 -> ConsumeParameters -> ConsumeParameters
- setFlowId :: FlowId -> Config m -> Config m
- defaultConsumeParameters :: ConsumeParameters
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.
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.
defaultConsumeParameters :: ConsumeParameters Source #
Default parameters for event consumption.