-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Throttle Conduit Producers
--   
--   This packages is based on the throttle-io-stream package and provides
--   functionality for throttling Conduit producers according to a provided
--   configuration.
@package conduit-throttle
@version 0.3.1.0

module Data.Conduit.Throttle
data Conf a
newConf :: Conf a

-- | Set measure function in configuration.
setMeasure :: Measure a -> Conf a -> Conf a

-- | Set interval in configuration.
setInterval :: Double -> Conf a -> Conf a

-- | Set max throughput in configuration.
setMaxThroughput :: Double -> Conf a -> Conf a

-- | Set buffer size in configuration.
setBufferSize :: Int -> Conf a -> Conf a

-- | Set exponential weight factor used for computing current item size.
setEmaAlpha :: Double -> Conf a -> Conf a

-- | Given a <tt>ThrottleConf</tt> and a <a>Producer</a>, create and return
--   a new <a>Producer</a>, which yields the same stream of values like the
--   provided producer but throttled according to the provided throttling
--   configuration.
throttleProducer :: (MonadUnliftIO m, MonadResource m) => Conf o -> ConduitM () o m () -> ConduitM () o m ()

module Data.Conduit.Throttle.MBC
data Conf a
newConf :: Conf a

-- | Set measure function in configuration.
setMeasure :: Measure a -> Conf a -> Conf a

-- | Set interval in configuration.
setInterval :: Double -> Conf a -> Conf a

-- | Set max throughput in configuration.
setMaxThroughput :: Double -> Conf a -> Conf a

-- | Set buffer size in configuration.
setBufferSize :: Int -> Conf a -> Conf a

-- | Set exponential weight factor used for computing current item size.
setEmaAlpha :: Double -> Conf a -> Conf a

-- | Given a <tt>ThrottleConf</tt> and a <a>Producer</a>, create and return
--   a new <a>Producer</a>, which yields the same stream of values like the
--   provided producer but throttled according to the provided throttling
--   configuration.
throttleProducer :: (MonadIO m, MonadBaseControl IO m, MonadResource m) => Conf o -> ConduitM () o m () -> ConduitM () o m ()
