Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module introduces functions that allow to run action in parallel with logging.
- data WaitingDelta
- = WaitOnce (Time Second)
- | WaitLinear (Time Second)
- | WaitGeometric (Time Second) RatioNat
- type CanLogInParallel m = (MonadBaseControl IO m, WithLoggerIO m)
- logWarningLongAction :: forall m a. CanLogInParallel m => (Text -> m ()) -> WaitingDelta -> Text -> m a -> m a
- logWarningWaitOnce :: CanLogInParallel m => Time Second -> Text -> m a -> m a
- logWarningWaitLinear :: CanLogInParallel m => Time Second -> Text -> m a -> m a
- logWarningWaitInf :: CanLogInParallel m => Time Second -> Text -> m a -> m a
Documentation
data WaitingDelta Source #
Data type to represent waiting strategy for printing warnings if action take too much time.
WaitOnce (Time Second) | wait s seconds and stop execution |
WaitLinear (Time Second) | wait s, s * 2, s * 3 , s * 4 , ... seconds |
WaitGeometric (Time Second) RatioNat | wait m, m * q, m * q^2, m * q^3, ... microseconds |
type CanLogInParallel m = (MonadBaseControl IO m, WithLoggerIO m) Source #
Constraint for something that can be logged in parallel with other action.
logWarningLongAction :: forall m a. CanLogInParallel m => (Text -> m ()) -> WaitingDelta -> Text -> m a -> m a Source #
Run action and print warning if it takes more time than expected.
logWarningWaitOnce :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #
Specialization of logWarningLongAction
with WaitOnce
.
logWarningWaitLinear :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #
Specialization of logWarningLongAction
with WaiLinear
.
logWarningWaitInf :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #
Specialization of logWarningLongAction
with WaitGeometric
with parameter 1.3
. Accepts Second
.