zio / zio-process

A simple ZIO library for interacting with external processes and command-line programs
https://zio.dev/zio-process
Apache License 2.0
64 stars 13 forks source link

Make all process operators interruptible #430

Open reibitto opened 2 months ago

reibitto commented 2 months ago

Closes #425

Methods like exitCode were interruptible but in particular the stream operators weren't interruptible. That should be fixed now.

Also Scala.js and Scala Native interruption weren't working at all. I wasn't familiar with either Scala.js and Scala Native or the implementations that were added, but I managed to get Scala.js interruption fully working. Scala Native interruption is only partially working but it's an improvement over the previous state of things. Particularly .timeout(...) isn't interrupting the process. Nothing I do works so perhaps it's Scala Native limitation currently. I'll keep an eye on it and see if a future Scala Native upgrade fixes the internal waitFor method.

As part of this, I added proper tests for interruption for each operator (not just exitCode). It's confirmed to be working.