polysemy-process-0.11.1.0: Polysemy effects for system processes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Process.SystemProcess

Description

The effect SystemProcess is a low-level abstraction of a native system process.

Synopsis

Documentation

data SystemProcess :: Effect Source #

Low-level interface for a process, operating on raw chunks of bytes. Interface is modeled after System.Process.

Instances

Instances details
type DefiningModule SystemProcess Source # 
Instance details

Defined in Polysemy.Process.Effect.SystemProcess

type DefiningModule SystemProcess = "Polysemy.Process.Effect.SystemProcess"

withSystemProcess :: forall param err r. Member (Scoped param (SystemProcess !! err)) r => param -> InterpreterFor (SystemProcess !! err) r Source #

Create a scoped resource for SystemProcess. The process configuration may depend on the provided value of type param.

interrupt :: Member SystemProcess r => Sem r () Source #

Send signal INT(2) to the process.

type SysProcConf = ProcessConfig () () () Source #

Convenience alias for a vanilla ProcessConfig, which will usually be transformed by interpreters to use Handles.

interpretSystemProcessNative :: forall param r. Members [Resource, Embed IO] r => (param -> Sem r (Either Text SysProcConf)) -> InterpreterFor (Scoped param (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r Source #

Interpret SystemProcess as a scoped Process that's started wherever withSystemProcess is called and terminated when the wrapped action finishes. This variant is for parameterized scopes, allowing the consumer to supply a value of type param to create the process config.

currentPid :: Member (Embed IO) r => Sem r Pid Source #

Obtain the current process's Pid.