streamly-0.10.1: Streaming, dataflow programming and declarative concurrency
Copyright(c) 2017 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Control.ForkLifted

Description

 
Synopsis

Documentation

doFork :: MonadRunInIO m => m () -> RunInIO m -> (SomeException -> IO ()) -> m ThreadId Source #

Fork a thread to run the given computation, installing the provided exception handler. Lifted to any monad with 'MonadRunInIO m' capability.

TODO: the RunInIO argument can be removed, we can directly pass the action as "mrun action" instead.

doForkWith :: MonadRunInIO m => Bool -> m () -> RunInIO m -> (SomeException -> IO ()) -> m ThreadId Source #

Similar to doFork, but has a "bound" boolean parameter for specifying whether forkOS should be used instead of rawForkIO.

fork :: MonadRunInIO m => m () -> m ThreadId Source #

fork lifted to any monad with 'MonadBaseControl IO m' capability.

forkManaged :: MonadRunInIO m => m () -> m ThreadId Source #

Fork a thread that is automatically killed as soon as the reference to the returned threadId is garbage collected.