Popularity
3.0
Declining
Activity
0.0
Stable
1
3
0

Monthly Downloads: 6
Programming language: Haskell
License: MIT License
Tags: Concurrency    
Latest version: v0.1.0

sharedio alternatives and similar packages

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

Do you think we are missing an alternative of sharedio or a related project?

Add another 'Concurrency' Package

README

haskell-sharedio

Allows "bundling" or "throttling" of concurrent IO to perform computation only once.

Useful in situations where concurrency can be expensive, such as file system scans (where concurrent execution usually returns the same result but introduces much disk seeking overhead).

Example

import Control.Concurrent.SharedIO (SharedIO, newSharedIO, withSharedIO)

-- A webserver that lists directory contents, using
-- SharedIO to bundle clients fanatically hitting refresh.

-- Without this, the file seeking would slow the server to a crawl.

main = do
    fileScanSharedIO <- newSharedIO
    runWebserver (handleRequest fileScanSharedIO)

handleRequest :: SharedIO -> IO [FilePath]
handleRequest fileScanSharedIO = do
    withSharedIO fileScanSharedIO (getDirectoryContents "largefolder")