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

Polysemy.Process.Interpreter.ProcessOneshot

Description

 
Synopsis

Documentation

interpretProcessOneshot :: forall param proc i o r. Members (ProcessIO i o) r => Member (Scoped proc (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r => Members [Resource, Race, Async, Embed IO] r => ProcessOptions -> (param -> Sem (Stop SystemProcessScopeError ': r) proc) -> InterpreterFor (Scoped param (Process i o !! ProcessError) !! SystemProcessScopeError) r Source #

Interpret Process with a system process resource whose file descriptors are connected to three TBMQueues, deferring decoding of stdout and stderr to the interpreters of two ProcessOutput effects. Unlike interpretProcess, this variant sends errors inside the scope to the individual Process actions. This variant is for parameterized scopes, meaning that a value of arbitrary type may be passed to withProcessOneshotParam which is then passed to the supplied function to produce a SysProcConf for the native process.

interpretProcessOneshotNative :: forall param i o r. Members (ProcessIO i o) r => Members [Resource, Race, Async, Embed IO] r => ProcessOptions -> (param -> Sem r (Either Text SysProcConf)) -> InterpreterFor (Scoped param (Process i o !! ProcessError) !! SystemProcessScopeError) r Source #

Interpret Process as a native SystemProcess. This variant is for parameterized scopes, meaning that a value of arbitrary type may be passed to withProcessOneshotParam which is then passed to the supplied function to produce a SysProcConf for the native process.