throttle-io-stream: Throttler between arbitrary IO producer and consumer functions

[ bsd3, concurrency, library ] [ Propose Tags ]
Dependencies async, base (>=4.7 && <5), clock, stm, stm‑chans [details]
License BSD-3-Clause
Copyright (c) 2017 Moritz Schulte
Author Moritz Schulte
Category Concurrency
Home page
Bug tracker
Source repo head: git clone
Uploaded by mtesseract at Sun Sep 3 21:11:24 UTC 2017
Distributions LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 317 total (8 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-09-03 [all 1 reports]
Hackage Matrix CI

This packages provides functionality for throttling IO using general IO callbacks. The throttling depends on a provided configuration. The supported throttling modes are producer throttling, consumer throttling or producer & consumer throttling.

[Skip to Readme]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for throttle-io-stream-

[back to package description]

throttle-io-stream Hackage version Stackage version Build Status


This packages provides throttling functionality for arbitrary IO producers and consumers. The core function exported is the following:

throttle :: ThrottleConf a     -- ^ Throttling configuration
         -> IO (Maybe a)       -- ^ Input callback
         -> (Maybe a -> IO ()) -- ^ Output callback
         -> IO (Async ())      -- ^ Returns an async handler for this
                               -- throttling process

This will spawn asynchronous operations that

  1. consume data using the provided input callback and write it into an internal buffering queue and

  2. produce data from the buffering queue using the provided consumer callback.