Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The effect SystemProcess
is a low-level abstraction of a native system process.
Synopsis
- data SystemProcess :: Effect
- withSystemProcess :: forall param err r. Member (Scoped param (SystemProcess !! err)) r => param -> InterpreterFor (SystemProcess !! err) r
- interrupt :: Member SystemProcess r => Sem r ()
- type SysProcConf = ProcessConfig () () ()
- interpretSystemProcessWithProcess :: forall r. Member (Embed IO) r => Process Handle Handle Handle -> InterpreterFor (SystemProcess !! SystemProcessError) r
- interpretSystemProcessNativeSingle :: forall r. Members [Stop SystemProcessScopeError, Resource, Embed IO] r => SysProcConf -> InterpreterFor (SystemProcess !! SystemProcessError) r
- interpretSystemProcessNative :: forall param r. Members [Resource, Embed IO] r => (param -> Sem r (Either Text SysProcConf)) -> InterpreterFor (Scoped param (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r
- module Polysemy.Process.SysProcConf
- currentPid :: Member (Embed IO) r => Sem r Pid
Documentation
data SystemProcess :: Effect Source #
Low-level interface for a process, operating on raw chunks of bytes. Interface is modeled after System.Process.
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
.
type SysProcConf = ProcessConfig () () () Source #
Convenience alias for a vanilla ProcessConfig
, which will usually be transformed by interpreters to use Handle
s.
interpretSystemProcessWithProcess :: forall r. Member (Embed IO) r => Process Handle Handle Handle -> InterpreterFor (SystemProcess !! SystemProcessError) r Source #
Interpret SystemProcess
with a concrete Process
with connected pipes.
interpretSystemProcessNativeSingle :: forall r. Members [Stop SystemProcessScopeError, Resource, Embed IO] r => SysProcConf -> InterpreterFor (SystemProcess !! SystemProcessError) r Source #
Interpret SystemProcess
as a single global Process
that's started immediately.
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.
module Polysemy.Process.SysProcConf