stm-promise-0.0.3.1: Simple STM Promises for IO computations and external processes

Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Concurrent.STM.Promise.Process

Description

Promises for processes

Synopsis

Documentation

processPromise Source

Arguments

:: FilePath

Program to run

-> [String]

Arguments

-> String

Input string (stdin)

-> IO (Promise ProcessResult)

Promise object

Make a Promise

processPromiseCallback Source

Arguments

:: (ProcessResult -> IO ())

Callback

-> FilePath

Program to run

-> [String]

Arguments

-> String

Input string (stdin)

-> IO (Promise ProcessResult)

Promise object

Make a Promise, but add a callback that will be run when the process finishes nicely. This hook is mainly intended for logging.

data ProcessResult Source

The result from a process

Constructors

ProcessResult 

data ExitCode :: *

Defines the exit codes that a program can return.

Constructors

ExitSuccess

indicates successful termination;

ExitFailure Int

indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).