This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Concurrent[F].start(stream.compile.toVector) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sync[F].delay { | |
systemProcess.isAlive | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class WrappedProcess[F[_] : Sync, // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IO { | |
systemProcess.isAlive | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Process[F[_], Out, Err, OutResult, ErrResult, IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState] | |
(val command: String, | |
val arguments: List[String], | |
val workingDirectory: Option[Path], | |
val inputSource: ProcessInputSource[F], | |
val outputTarget: ProcessOutputTarget[F, Out, OutResult], | |
val errorTarget: ProcessErrorTarget[F, Err, ErrResult], | |
val environmentVariables: Map[String, String], | |
val removedEnvironmentVariables: Set[String]) | |
extends ProcessNode[Out, Err, IRS, ORS, ERS] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def apply(process: PN, | |
dontStartOutput: Boolean = false, | |
blocker: Blocker) | |
(implicit | |
concurrent: Concurrent[F], | |
contextShift: ContextShift[F]): F[RunningProcesses] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def apply(process: PN, dontStartOutput: Boolean = false, blocker: Blocker) | |
(implicit contextShift: ContextShift[IO]): IO[RunningProcesses] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val utf8Decode: Sink[ByteString, Future[String]] = | |
Flow[ByteString] | |
.reduce(_ ++ _) | |
.map(_.utf8String) | |
.toMat(Sink.head)(Keep.right) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val customPipe = Framing.delimiter( | |
delimiter = ByteString("\n"), | |
maximumFrameLength = 10000, | |
allowTruncation = true | |
).map(_.utf8String) | |
.map(_.split(' ').toVector) | |
.map(v => v.map(_ + " !!!").mkString(" ")) | |
.intersperse("\n") | |
.map(ByteString.apply) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val customPipe: Pipe[IO, Byte, Byte] = | |
(s: Stream[IO, Byte]) => s | |
.through(text.utf8Decode) | |
.through(text.lines) | |
.map(_.split(' ').toVector) | |
.map(v => v.map(_ + " !!!").mkString(" ")) | |
.intersperse("\n") | |
.through(text.utf8Encode) | |
val proc = Process("echo", List("This is a test string")) |