Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Pid msg
- data Process msg a
- data Reason
- class IsProcess a p | p -> a where
- data LinkId
- spawn :: Process msg () -> IO (Pid msg)
- linkIO :: IsProcess msg p => p -> (Reason -> IO ()) -> IO LinkId
- unlinkIO :: IsProcess msg p => p -> LinkId -> IO ()
- withLinkIO :: IsProcess msg p => p -> (Reason -> IO ()) -> (LinkId -> IO a) -> IO a
- withLinkIO_ :: IsProcess msg p => p -> (Reason -> IO ()) -> IO a -> IO a
- link :: IsProcess msg p => p -> Process msg LinkId
- send :: Pid msg -> msg -> Process a ()
- sendIO :: Pid msg -> msg -> IO ()
- receive :: MonadProcess msg m => m msg
- receiveWithTimeout :: MonadProcess msg m => Maybe Int -> m (Maybe msg)
- self :: MonadProcess msg m => m (Pid msg)
- exit :: MonadProcess msg m => m ()
- terminate :: IsProcess msg p => p -> IO ()
- isAlive :: IsProcess msg p => p -> IO Bool
- wait :: IsProcess msg p => p -> IO ()
- liftIO :: MonadIO m => forall a. IO a -> m a
Documentation
Identificator of process accepted messages of type msg
Process computation monad
Monad (Process msg) | |
Functor (Process msg) | |
Applicative (Process msg) | |
MonadThrow (Process msg) | |
MonadCatch (Process msg) | |
MonadIO (Process msg) |
Process termination reason
linkIO :: IsProcess msg p => p -> (Reason -> IO ()) -> IO LinkId Source
Register callback, which will be called on process termination and return subscription id. If process has died already, callback will be called immediatly.
withLinkIO :: IsProcess msg p => p -> (Reason -> IO ()) -> (LinkId -> IO a) -> IO a Source
Run action in under link bracket.
link :: IsProcess msg p => p -> Process msg LinkId Source
Link current process with another process p. Current process will be terminated, if process p will be terminated abnormal.
receive :: MonadProcess msg m => m msg Source
Get message from process mailbox. Blocked, if mailbox is empty, until message will be received.
receiveWithTimeout :: MonadProcess msg m => Maybe Int -> m (Maybe msg) Source
Get message from process mailbox with timeout in milliseconds. Blocked, if mailbox is empty, until message will be received or timeout will be expired.