The throttle-io-stream package

[ Tags: bsd3, concurrency, library ] [ Propose Tags ]

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]

Properties

Versions 0.2.0.0, 0.2.0.1
Dependencies async, base (>=4.7 && <5), clock, stm, stm-chans [details]
License BSD3
Copyright (c) 2017 Moritz Schulte
Author Moritz Schulte
Maintainer mtesseract@silverratio.net
Category Concurrency
Home page https://github.com/mtesseract/throttle-io-stream#readme
Bug tracker https://github.com/mtesseract/throttle-io-stream/issues
Source repository head: git clone https://github.com/mtesseract/throttle-io-stream
Uploaded Sun Sep 3 21:11:24 UTC 2017 by mtesseract
Distributions NixOS:0.2.0.1, Stackage:0.2.0.1
Downloads 44 total (23 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-09-03 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for throttle-io-stream-0.2.0.1

[back to package description]

throttle-io-stream Hackage version Stackage version Build Status

About

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.