Safe Haskell | None |
---|---|
Language | Haskell2010 |
Strategies for dealing with message handle failures.
Synopsis
- data FailureReason
- newtype FailureStrategy = FailureStrategy {
- logFailure :: Message -> FailureReason -> IO ()
- ignoreFailures :: FailureStrategy
- writeToCategory :: (FailureReason -> Bool) -> WithConnection -> CategoryName -> FailureStrategy
- writeUnknownFailuresToCategory :: WithConnection -> CategoryName -> FailureStrategy
- writeAllToCategory :: WithConnection -> CategoryName -> FailureStrategy
Documentation
data FailureReason Source #
Reason why the message handle failed.
Instances
Show FailureReason Source # | |
Defined in MessageDb.Subscription.FailureStrategy showsPrec :: Int -> FailureReason -> ShowS # show :: FailureReason -> String # showList :: [FailureReason] -> ShowS # | |
Exception FailureReason Source # | |
Defined in MessageDb.Subscription.FailureStrategy |
newtype FailureStrategy Source #
Strategy for logging failures.
FailureStrategy | |
|
Instances
Semigroup FailureStrategy Source # | |
Defined in MessageDb.Subscription.FailureStrategy (<>) :: FailureStrategy -> FailureStrategy -> FailureStrategy # sconcat :: NonEmpty FailureStrategy -> FailureStrategy # stimes :: Integral b => b -> FailureStrategy -> FailureStrategy # | |
Monoid FailureStrategy Source # | |
Defined in MessageDb.Subscription.FailureStrategy mappend :: FailureStrategy -> FailureStrategy -> FailureStrategy # mconcat :: [FailureStrategy] -> FailureStrategy # |
ignoreFailures :: FailureStrategy Source #
Do nothing, ignore all failures.
writeToCategory :: (FailureReason -> Bool) -> WithConnection -> CategoryName -> FailureStrategy Source #
Write a failure to a category. Use shouldKeep
to filter out message failures you don't want to log.
writeUnknownFailuresToCategory :: WithConnection -> CategoryName -> FailureStrategy Source #
Only write UnknownFailure
s to a category.
writeAllToCategory :: WithConnection -> CategoryName -> FailureStrategy Source #
Write either UnknownFailure
s or HandleFailure
s to a category.