object syntax
Implicit classes for working with simple and piped processes
All the operations are implemented for both simple Process objects and PipedProcess objects as well. Most of the operations encode information in the types of the processes as well.
The operations are implemented by various type classes and exposed through extension methods defined in the implicit classes in this object.
Examples
Starting simple and piped processes:
val echoProcess = Process("echo", List("This is an output")) val wordCountProcess = Process("wc", List("-w")) val combined = echoProcess | wordCountProcess for { echo1 <- Process("echo", List("Hello world")).start runningProcs <- combined.start (echo2, wordCount) = runningProcs } yield ()
Redirecting input, output and error channels:
val p1 = Process("echo", List("Hello world")) > (home / "tmp" / "out.txt") val p2 = Process("cat") < (home / "something") val p3 = Process("make") errorTo (home / "errors.log")
Piping:
val echoProcess = Process("echo", List("This is an output")) val wordCountProcess = Process("wc", List("-w")) val combined1 = echoProcess | wordCountProcess val customPipe: Pipe[IO, Byte, Byte] = ??? val combined2 = echoProcess.via(customPipe).to(wordCountProcess)
- Alphabetic
- By Inheritance
- syntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- implicit class ProcessNodeErrorRedirect[PN <: ProcessNode[_, _, _, _, NotRedirected]] extends AnyRef
- implicit class ProcessNodeInputRedirect[PN <: ProcessNode[_, _, NotRedirected, _, _]] extends AnyRef
- implicit class ProcessNodeOutputRedirect[PN <: ProcessNode[_, _, _, NotRedirected, _]] extends AnyRef
- implicit class ProcessOps[PN <: ProcessNode[_, _, _, _, _]] extends AnyRef