stream :: Int -> ((a -> IO ()) -> IO ()) -> (a -> IO ()) -> IO ()
Maps a fixed number of workers concurrently over a stream of values produced by a producer function. The producer is passed a function to call for each work item. If a worker throws a synchronous exception, it will be propagated to the caller.
IntMaximum Concurrency
((a -> IO ()) -> IO ())Producer
(a -> IO ())Worker