Popularity
3.6
Declining
Activity
0.0
Stable
6
2
0

Monthly Downloads: 4
Programming language: Haskell
License: MIT License
Tags: Concurrency    

io-throttle alternatives and similar packages

Based on the "Concurrency" category.
Alternatively, view io-throttle alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of io-throttle or a related project?

Add another 'Concurrency' Package

README

io-throttle

Build Status

Limit the number of tasks started per second. The throttle function will run all actions concurrently but only starting a certain number per second. It will wait for all tasks and return the results in a list.

Example

module Main where

import Control.Concurrent
import Control.Concurrent.Throttle
import Control.Monad

main :: IO ()
main = do results <- throttle 5 tasks
          putStrLn $ "------ RESULTS: ------"
          forM_ results print
  where
    tasks = map performTask ([1..100] :: [Int])
    performTask i = do putStrLn $ "started task: " ++ show i
                       threadDelay $ i * 10000
                       putStrLn $ "task finished: " ++ show i
                       return i