Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Control.Concurrent.Worker
- data Worker m = Worker {
- workerChan :: Chan (Async (), m ())
- workerWrap :: forall a. m a -> m a
- workerTask :: MVar (Async ())
- workerRestart :: IO Bool
- startWorker :: MonadIO m => (m () -> IO ()) -> (m () -> m ()) -> (forall a. m a -> m a) -> IO (Worker m)
- sendTask :: (MonadCatch m, MonadIO m) => Worker m -> m a -> IO (Async a)
- pushTask :: (MonadCatch m, MonadIO m) => Worker m -> m a -> IO (Async a)
- stopWorker :: Worker m -> IO ()
- syncTask :: (MonadCatch m, MonadIO m) => Worker m -> IO ()
- inWorkerWith :: (MonadIO m, MonadCatch m, MonadIO n) => (SomeException -> n a) -> Worker m -> m a -> n a
- inWorker :: (MonadIO m, MonadCatch m) => Worker m -> m a -> IO a
- inWorker_ :: (MonadIO m, MonadCatch m) => Worker m -> m a -> ExceptT SomeException IO a
- module Control.Concurrent.Async
Documentation
Constructors
Worker | |
Fields
|
startWorker :: MonadIO m => (m () -> IO ()) -> (m () -> m ()) -> (forall a. m a -> m a) -> IO (Worker m) Source
Create new worker
stopWorker :: Worker m -> IO () Source
syncTask :: (MonadCatch m, MonadIO m) => Worker m -> IO () Source
Send empty task and wait until worker run it
inWorkerWith :: (MonadIO m, MonadCatch m, MonadIO n) => (SomeException -> n a) -> Worker m -> m a -> n a Source
Run action in worker and wait for result
inWorker :: (MonadIO m, MonadCatch m) => Worker m -> m a -> IO a Source
Run action in worker and wait for result
inWorker_ :: (MonadIO m, MonadCatch m) => Worker m -> m a -> ExceptT SomeException IO a Source
Run action in worker and wait for result
module Control.Concurrent.Async