Copyright | (c) Moritz Schulte 2017 |
---|---|
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.
- defaultRetryPolicy :: MonadIO m => RetryPolicyM m
- newConfig' :: (MonadIO m, MonadThrow m) => Manager -> ConsumeParameters -> Request -> m Config
- defaultHttpBackend :: HttpBackend
- newConfig :: (MonadIO m, MonadThrow m) => Maybe ManagerSettings -> Request -> m Config
- setRequestModifier :: (Request -> IO Request) -> Config -> Config
- setDeserializationFailureCallback :: (ByteString -> Text -> IO ()) -> Config -> Config
- setStreamConnectCallback :: StreamConnectCallback -> Config -> Config
- setHttpErrorCallback :: HttpErrorCallback -> Config -> Config
- setLogFunc :: LogFunc -> Config -> Config
- setRetryPolicy :: RetryPolicyM IO -> Config -> Config
- setHttpBackend :: HttpBackend -> Config -> Config
- defaultConsumeParameters :: ConsumeParameters
- 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 :: Text -> ConsumeParameters -> ConsumeParameters
Documentation
defaultRetryPolicy :: MonadIO m => RetryPolicyM m Source #
Default retry policy.
:: (MonadIO m, MonadThrow m) | |
=> Manager | Manager Settings |
-> ConsumeParameters | Consumption Parameters |
-> Request | Request Template |
-> m Config | Resulting Configuration |
Producs a new configuration, with mandatory HTTP manager, default consumption parameters and HTTP request template.
defaultHttpBackend :: HttpBackend Source #
Default HttpBackend
doing IO using http-client.
:: (MonadIO m, MonadThrow m) | |
=> Maybe ManagerSettings | Optional |
-> Request | Request template for Nakadi requests |
-> m Config | Resulting Configuration |
Produce a new configuration, with optional HTTP manager settings and mandatory HTTP request template.
setRequestModifier :: (Request -> IO Request) -> Config -> Config 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 -> IO ()) -> Config -> Config Source #
Install a callback in the provided configuration to use in case of deserialization failures when consuming events.
setStreamConnectCallback :: StreamConnectCallback -> Config -> Config Source #
Install a callback in the provided configuration which is used after having successfully established a streaming Nakadi connection.
setHttpErrorCallback :: HttpErrorCallback -> Config -> Config 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 -> Config -> Config Source #
Install a logger callback in the provided configuration.
setRetryPolicy :: RetryPolicyM IO -> Config -> Config Source #
Set a custom retry policy in the provided configuration.
setHttpBackend :: HttpBackend -> Config -> Config Source #
Set a custom HTTP Backend in the provided configuration. Can be used for testing.
defaultConsumeParameters :: ConsumeParameters Source #
Default parameters for event consumption.
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 :: Text -> ConsumeParameters -> ConsumeParameters Source #
Set flow ID in the provided value of value of consumption parameters.