async-pool
async-pool copied to clipboard
`runConcurrently` hangs whenever a number of tasks is greater than the pool capacity
Suppose, I have the following piece of code
import Control.Concurrent.Async.Pool (Concurrently(..), withTaskGroup)
main :: IO ()
main = do
let xs = [1, 2, 3, 5, 6] :: [Int]
s <- withTaskGroup 4
(runConcurrently (sum <$> traverse (Concurrently . const . pure) xs))
print s
It hangs whenever the pool size is lesser than the number of tasks. E.g. the code above hangs, but if we change pool size from 4 to 5, it doesn't.
This appears to be a duplicate of #7
It seems so, but #7 is closed and the underlying issue with Concurrently is not fixed.