``` interface ProcessJob { //working title :p va...
# coroutines
g
Copy code
interface ProcessJob { //working title :p
  val standardOut: BroadcastChannel<Char> //lazy, dont attach a pump unless somebody calls `get`. Dont buffer.
  val standardError: BroadcastChannel<Char>
  
  fun cancel(forcefully: Boolean = false) //returns instantly,
  //as zero-turnaround taught me, theres a couple of timeouts that are needed, but good defaults can probably be picked & overidden by System.getProp

  suspend fun await(): Int? 
}

fun exec(cmd: List<String>, timeout: Duration): Int? = ...
fun execAsync(cmd: List<String>, timeout: Duration): ProcessJob = ...