Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data RunError a
- renderRunError :: RunError a -> (a -> Text) -> Text
- consume_ :: MonadIO m => (Queue b -> IO a) -> Int -> (b -> EitherT e IO ()) -> EitherT (RunError e) m a
- consume :: forall a b c e. (Queue a -> IO b) -> Int -> (a -> IO (Either e c)) -> IO (Either (RunError e) (b, [c]))
- waitEitherBoth :: Async a -> Async b -> Async c -> IO (Either a (b, c))
Documentation
consume_ :: MonadIO m => (Queue b -> IO a) -> Int -> (b -> EitherT e IO ()) -> EitherT (RunError e) m a Source #
Provide a producer and an action to be run across the result of that producer in parallel.
Common usage: @ let producer :: Address -> Queue Address -> IO () producer prefix q = list' prefix $$ writeQueue q
consume producer 100 ((a :: Address) -> doThis) @