This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
HSL subprocess design considerations/approach #193
fredemmott
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This document has suggestions for how to approach designing HSL subprocess, rather than a concrete suggestion for the design itself.
Requirements
does not require interoperability with PHP resources; e.g. removing proc_open from www would require changing existing callsites to replace their usage of PHP resources for pipes with HSL IO.
Does not require removal of existing PHP builtins, just the potential to migrate to them
Compare with other languages
I strongly recommend looking at other modern languages/frameworks to see how they address subprocesses; I would start by looking at Rust, Scala, Python3, Ruby, folly::subprocess (C++) and QProcess from Qt (also C++). A full comparison with each isn’t needed, and you don’t have to base the design on one of them, but they’re useful to learn from. Look for:
For example, HSL IO can be considered a more strictly-typed hybrid of Rust and Java’s IO APIs, but with Python3’s IO/OS exception model.
References
Async wait for exit: facebook/hhvm#8942
Handling of STDIN: FB-only link. In short, many programs do not handle FDs 1/2/3 being closed well, especially when an open()/connect()... allocates FD1 for something else. Safer to default to having the FDs open, but attached to
/dev/null
Other people to talk to
Beta Was this translation helpful? Give feedback.
All reactions