polysemy-process-0.13.0.1: Polysemy effects for system processes
Safe HaskellSafe-Inferred
LanguageGHC2021

Polysemy.Process.Effect.SystemProcess

Description

 
Synopsis

Documentation

data SystemProcess :: Effect where Source #

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

Constructors

ReadStdout :: SystemProcess m ByteString

Read a chunk from stdout.

ReadStderr :: SystemProcess m ByteString

Read a chunk from stderr.

WriteStdin :: ByteString -> SystemProcess m ()

Write a ByteString to stdin.

Pid :: SystemProcess m Pid

Obtain the process ID.

Signal :: Signal -> SystemProcess m ()

Send a Signal to the process.

Wait :: SystemProcess m ExitCode

Wait for the process to terminate, returning its exit code.

wait :: forall r. Member SystemProcess r => Sem r ExitCode Source #

Wait for the process to terminate, returning its exit code.

signal :: forall r. Member SystemProcess r => Signal -> Sem r () Source #

Send a Signal to the process.

pid :: forall r. Member SystemProcess r => Sem r Pid Source #

Obtain the process ID.

writeStdin :: forall r. Member SystemProcess r => ByteString -> Sem r () Source #

Write a ByteString to stdin.

readStderr :: forall r. Member SystemProcess r => Sem r ByteString Source #

Read a chunk from stderr.

readStdout :: forall r. Member SystemProcess r => Sem r ByteString Source #

Read a chunk from stdout.

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.

withSystemProcess_ :: forall err r. Member (Scoped_ (SystemProcess !! err)) r => InterpreterFor (SystemProcess !! err) r Source #

Create a scoped resource for SystemProcess. The process configuration is provided to the interpreter statically.

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

Send signal INT(2) to the process.

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

Send signal TERM(15) to the process.

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

Send signal KILL(9) to the process.