streamly-process-0.2.0.1: Use OS processes as stream transformation functions
Copyright(c) 2020 Composewell Technologies
LicenseApache-2.0
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.System.Process.Posix

Contents

Description

 
Synopsis

Processes

data Process Source #

Thread safe, mutable process handle. Process status is stored in the handle and is modified by the process inspection operations.

newProcess Source #

Arguments

:: IO ()

Execute after fork, before exec

-> FilePath

Executable path

-> [String]

Arguments

-> Maybe [(String, String)]

Environment

-> IO Process 

Creates a new process, executes the specified action in the cloned process and then performs an exec system call using the provided path, arguments and environment. The PATH is searched for the specified binary when the specified path is not absolute?

wait :: Process -> IO ProcessStatus Source #

Wait until the process exits by itself or gets terminated due to a signal. Returns the ProcessStatus which includes the termination reason or exit code.

Thread safe.

getStatus :: Process -> IO (Maybe ProcessStatus) Source #

Get the current status of a process. A Nothing value means the process is still running, a Just value means the process is terminated and provides the status of the process.

Thread safe.

IPC

mkPipe :: Direction -> IO (Fd, Fd, (IO (), IO (), IO ())) Source #

return (parent, child, (parentAction, childAction, failureAction))