package prox
Provides classes to work with system processes in a type safe way.
Refer to the user guide for more information.
A process to be executed is represented by the Process trait. Once it has finished running the results are in ProcessResult. We call a group of processes attached together a process group, represented by ProcessGroup, its result is described by ProcessGroupResult.
Redirection of input, output and error is enabled by the RedirectableInput, RedirectableOutput and RedirectableError trait for single processes, and the RedirectableErrors trait for process groups.
Processes and process groups are executed by a ProcessRunner, the default implementation is called JVMProcessRunner.
- Alphabetic
- By Inheritance
- prox
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class AllCaptured[F[_], O, OR](pipeFn: (Process[F, _, _]) => Pipe[F, Byte, O], runner: (Stream[F, O]) => F[OR], chunkSize: Int = 8192) extends GroupErrorRedirection[F] with Product with Serializable
- case class AllToFile[F[_]](pathFn: (Process[F, _, _]) => Path, append: Boolean) extends GroupErrorRedirection[F] with Product with Serializable
- case class AllToStdErr[F[_]]() extends GroupErrorRedirection[F] with Product with Serializable
- sealed trait GroupErrorRedirection[F[_]] extends AnyRef
Supported process group error redirection types.
Supported process group error redirection types. Should not be used directly, see the redirection traits instead.
- trait GroupErrorRedirectionType[F[_], R] extends AnyRef
Helper type class for process group error redirection dependent typing
- case class InputFile[F[_]](path: Path) extends InputRedirection[F] with Product with Serializable
- sealed trait InputRedirection[F[_]] extends AnyRef
Supported input redirection types.
Supported input redirection types. Should not be used directly, see the redirection traits instead.
- case class InputStream[F[_]](stream: Stream[F, Byte], flushChunks: Boolean) extends InputRedirection[F] with Product with Serializable
- class JVMProcessRunner[F[_]] extends ProcessRunner[F]
Default implementation of ProcessRunner using the Java process API
- class JVMRunningProcess[F[_], O, E] extends RunningProcess[F, O, E]
Default implementation of RunningProcess using the Java process API
- class JVMRunningProcessGroup[F[_], O, E] extends RunningProcessGroup[F, O, E]
Default implementation of RunningProcessGroup using the Java process API
- case class OutputFile[F[_]](path: Path, append: Boolean) extends OutputRedirection[F] with Product with Serializable
- sealed trait OutputRedirection[F[_]] extends AnyRef
Supported output redirection types.
Supported output redirection types. Should not be used directly, see the redirection traits instead.
- trait OutputRedirectionType[F[_], R] extends AnyRef
Helper type class for output and error redirection dependent typing
- case class OutputStream[F[_], O, OR](pipe: Pipe[F, Byte, O], runner: (Stream[F, O]) => F[OR], chunkSize: Int = 8192) extends OutputRedirection[F] with Product with Serializable
- trait Process[F[_], O, E] extends ProcessLike[F]
Describes a system process to be executed
Describes a system process to be executed
This base trait is always extended with redirection and configuration capabilities represented by the traits ProcessConfiguration, RedirectableInput, RedirectableOutput and RedirectableError.
To create a process use the constructor in the companion object Process.apply.
The process specification not only encodes the process to be started but also how its input, output and error streams are redirected and executed. For this reason the effect type is also bound by the process, not just at execution time.
- F
Effect type
- O
Output type
- E
Error output type
- trait ProcessConfiguration[F[_], +P <: Process[F, _, _]] extends AnyRef
The capability to configure process execution details
The capability to configure process execution details
- F
Effect type
- P
Self type
- trait ProcessGroup[F[_], O, E] extends ProcessLike[F]
Process group is two or more processes attached to each other
Process group is two or more processes attached to each other
This implements a pipeline of processes. The input of the first process and the output of the last process is redirectable with the RedirectableInput and RedirectableOutput traits. The processes are attached to each other's input/output streams, the pipe between them is customizable.
The error streams are also redirectable with the RedirectableErrors trait.
- F
Effect type
- O
Output type
- E
Error output type
- trait ProcessGroupResult[F[_], +O, +E] extends AnyRef
Result of an executed process group
Result of an executed process group
- F
Effect type
- O
Output type
- E
Error output type
- trait ProcessLike[F[_]] extends AnyRef
Common base trait for processes and process groups, used in constraints in the redirection traits
- trait ProcessResult[+O, +E] extends AnyRef
Result of a finished process
Result of a finished process
- O
Output type
- E
Error output type
- trait ProcessRunner[F[_]] extends AnyRef
Interface for running processes and process groups
Interface for running processes and process groups
The default implementation is JVMProcessRunner
- F
Effect type
- trait RedirectableError[F[_], +P[_] <: Process[F, _, _]] extends AnyRef
The capability to redirect the error output of a process
The capability to redirect the error output of a process
- F
Effect type
- P
Self type without the RedirectableError capability
- trait RedirectableErrors[F[_], +P[_] <: ProcessGroup[F, _, _]] extends AnyRef
The capability to redirect all the error outputs simultaneously of a process group
The capability to redirect all the error outputs simultaneously of a process group
- F
Effect type
- P
Self type without the RedirectableErrors capability
- trait RedirectableInput[F[_], +P <: ProcessLike[F]] extends AnyRef
The capability to redirect the input of a process or process group
- trait RedirectableOutput[F[_], +P[_] <: ProcessLike[F]] extends AnyRef
The capability to redirect the output of a process or a process group
The capability to redirect the output of a process or a process group
- F
Effect type
- P
Self type without the RedirectableOutput capability
- trait RunningProcess[F[_], O, E] extends AnyRef
Representation of a running process
Representation of a running process
- F
Effect type
- O
Output type
- E
Error output type
- trait RunningProcessGroup[F[_], O, E] extends AnyRef
Representation of a running process group
Representation of a running process group
- F
Effect type
- O
Output type
- E
Error output type
- case class SimpleProcessGroupResult[F[_], +O, +E](exitCodes: Map[Process[F, Unit, Unit], ExitCode], output: O, errors: Map[Process[F, Unit, Unit], E]) extends ProcessGroupResult[F, O, E] with Product with Serializable
Default implementation of ProcessGroupResult
- case class SimpleProcessResult[+O, +E](exitCode: ExitCode, output: O, error: E) extends ProcessResult[O, E] with Product with Serializable
Default implementation of ProcessResult
- case class StdIn[F[_]]() extends InputRedirection[F] with Product with Serializable
- case class StdOut[F[_]]() extends OutputRedirection[F] with Product with Serializable
Value Members
- object GroupErrorRedirectionType
- object JVMProcessRunner
- object OutputRedirectionType
- object Process
- object ProcessGroup
- object RedirectableErrors
- object syntax