Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for spawning sub-processes #126

Closed
5 tasks done
Tracked by #388
talex5 opened this issue Jan 3, 2022 · 4 comments
Closed
5 tasks done
Tracked by #388

API for spawning sub-processes #126

talex5 opened this issue Jan 3, 2022 · 4 comments
Labels
api API design decision
Milestone

Comments

@talex5
Copy link
Collaborator

talex5 commented Jan 3, 2022

Eio needs to provide a way to create and manage sub-processes (like Lwt_process).

  • Must work in programs using multiple domains. Note that Unix.fork cannot be used there.
  • API should try to prevent bugs with argument splitting (e.g. avoid error-prone Unix.system style API by default). But also needs to work on Windows, where I think you can't provide an argv.
  • Child processes should be attached to a switch by default to avoid leaking them, but need a way to spawn detached sub-processes too.
  • Must allow passing pipes, etc, to child processes.
  • Must prevent accidentally leaking FDs to child processes. All FDs in Eio are already opened with close-on-exec set for this reason.
  • Should provide a simple way to check or report the process's exit status.

Possible sources of inspiration include:

Current status:

@talex5 talex5 added the api API design decision label Jan 10, 2022
@patricoferris
Copy link
Collaborator

Just a heads up that I've started looking into this as I'm going to need it for some applications I'm building. Hopefully will have a draft PR in the next week or two to iron out the details :))

@benmandrew
Copy link

Polite bump; this would be extremely useful for converting a lot of the ocurrent ecosystem to Eio. The work in ocurrent/obuilder#113 looks great so far!

@talex5
Copy link
Collaborator Author

talex5 commented Mar 27, 2023

The current PR (submitted 2 days ago) is here: #473

@talex5
Copy link
Collaborator Author

talex5 commented May 4, 2023

Implemented in #499.

@talex5 talex5 closed this as completed May 4, 2023
@balat balat added this to the Eio 1.0 milestone May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API design decision
Projects
None yet
Development

No branches or pull requests

4 participants