shelly-extra-0.2: shelly features that require extra dependencies

Safe HaskellSafe-Infered




Running external commands asynchronously.

jobs :: Int -> (BgJobManager -> ShIO a) -> ShIO aSource

Create a BgJobManager that has a limit on the max number of background tasks. an invocation of jobs is independent of any others, and not tied to the ShIO monad in any way. This blocks the execution of the program until all background jobs are finished.

background :: BgJobManager -> ShIO a -> ShIO (BgResult a)Source

Run the ShIO task asynchronously in the background, returns the `BgResult a`, a promise immediately. Run getBgResult to wait for the result. The background task will inherit the current ShIO context The BjJobManager ensures the max jobs limit must be sufficient for the parent and all children.

getBgResult :: BgResult a -> ShIO aSource

Returns the promised result from a backgrounded task. Blocks until the task completes.

data BgResult a Source

Type returned by tasks run asynchronously in the background.