Added output configurations. Related to #3170 #3543
Added output configurations. Related to #3170 #3543Dralt03 wants to merge 20 commits intotypelevel:mainfrom
Conversation
armanbilge
left a comment
There was a problem hiding this comment.
Nice start! Do you think you can also make the necessary changes to the Processes implementations?
| } | ||
|
|
||
| sealed trait ProcessOutputMode | ||
| object ProcessOutputMode { |
There was a problem hiding this comment.
These look like the right set of options! We need to support stdin, stdout, and stderr to be configured separately.
|
I think this should do it but do let me know if there is more to improve on this |
| } { process => | ||
| F.delay(process.isAlive()) | ||
| .ifM( | ||
| evalOnVirtualThreadIfAvailable( |
There was a problem hiding this comment.
Must've been deleted while solving merge conflicts adding them back
| sealed trait StreamOutputMode | ||
| object StreamOutputMode { | ||
| case object Pipe extends StreamOutputMode | ||
| case object Inherit extends StreamOutputMode | ||
| case object Ignore extends StreamOutputMode | ||
| case class FileOutput(path: Path) extends StreamOutputMode | ||
| } |
There was a problem hiding this comment.
| sealed trait StreamOutputMode | |
| object StreamOutputMode { | |
| case object Pipe extends StreamOutputMode | |
| case object Inherit extends StreamOutputMode | |
| case object Ignore extends StreamOutputMode | |
| case class FileOutput(path: Path) extends StreamOutputMode | |
| } | |
| sealed abstract class StreamRedirect | |
| object StreamRedirect { | |
| case object Pipe extends StreamRedirect | |
| case object Inherit extends StreamRedirect | |
| case object Discard extends StreamRedirect | |
| final case class File(path: Path) extends StreamRedirect | |
| } |
| env = | ||
|
|
||
|
|
||
| val spawnOptions = js.Dynamic.literal { |
There was a problem hiding this comment.
Instead of using js.Dynamic can you update the SpawnOptions face to add the additional fields?
| /** @see [[outputMode]] */ | ||
| def withOutputConfig(outputConfig: ProcessOutputConfig): ProcessBuilder |
There was a problem hiding this comment.
I think separating it out into three config methods for stdin/stdout/stderr (like the JDK process builder) will make the API easier to use.
armanbilge
left a comment
There was a problem hiding this comment.
Thanks for your work on this PR! Tests currently are not passing on JVM or JS. (Native is broken for reasons not related to you.)
|
@armanbilge The tests for rootJS are currently not passing for the merged option. Do you have an idea on how we can proceed with that. I'm thinking about setting the stdio to |
|
I think Node.js might not support that feature, so we can just implement it with FS2 |
Exposed a Configuration for the user to select how they want to deal with sterr and stdout for streams in /io/shared/src/main/scala/fs2/io/process/ProcessesBuilder.scala