mediabus-0.3.2.1: Multimedia streaming on top of Conduit

Safe HaskellNone
LanguageHaskell2010

Data.MediaBus.Conduit.Trace

Description

Probabilistic tracing conduits using Trace

Synopsis

Documentation

exitAfterC :: Monad m => Int -> Conduit a m a Source #

For profiling and debugging it can sometimes be useful, to have a circuit breaker, like this conduit, that exists after an given number of items have been processed, and, until then just yields all inputs.

traceShowC :: (Show a, Monad m) => Double -> String -> Conduit a m a Source #

Receive and trace the Shown value prefixed by a message and then yield down the stream. Since the number of elements sent over a conduit can be tremendous, a tracing probability parameter was added, that can be between 0.0 - 1.0, and sets the probability of with which a message will be traced. This uses traceM internally. Do not use this for logging.

traceShowSink :: (Show a, Monad m) => Double -> String -> Consumer a m [a] Source #

Like traceShowC but implemented as a Consumer that also returns all received inputs as a list when the conduit terminates.