-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
I'd like there to be an API that can spawn processes similarly to popen(3)
/ subprocess.run
.
The high-level API would be something like:
import process
process::spawn("cp", ["from.txt", "to.txt"]) // : ???
There are two main questions:
- How to actually implement this / what properties do we want?
Should spawn
only return the process ID? What would be the callback when the command gets run? Is it (a-)synchronous?
NodeJS has child_process[.spawn]
for this, libuv (for the LLVM backend) has spawn
. It's necessary to have such an API that works on both the [Node.]JS and the LLVM backends.
- How do we communicate with the process?
In simpler terms, how do we get the stdin/stdout/stderr of the new process?
Can/should it be streaming? How do we process failures (exit = 1
) and return codes in general? Can we do something with signals? IPC?...
Metadata
Metadata
Assignees
Type
Projects
Status
In Progress