ChildProcess: support bidirectional (duplex) additional file descriptors
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #8905 của @effect-bot — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start from the ChildProcessOptions.additionalFds type and NodeChildProcessSpawner implementation in the platform-node-shared package. Add a duplex variant to AdditionalFdConfig that provides both a Stream and a Sink for the same descriptor, then extend ChildProcessHandle with a getDuplexFd method. Verify the change with the existing child process test suite.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What is the problem this feature would solve?
ChildProcessOptions.additionalFds only lets you configure each extra descriptor in one direction:
type AdditionalFdConfig =
| { readonly type: "input"; readonly stream?: Stream<Uint8Array, PlatformError> }
| { readonly type: "output"; readonly sink?: Sink<Uint8Array, Uint8Array, never, PlatformError> }
The Node spawner (@effect/platform-node-shared/NodeChildProcessSpawner) sets each configured fd to "pipe". For fd ≥ 3, Node backs that with a bidirectional Unix domain socket. Effect then exposes it either as a Sink (getInputFd) or as a Stream (getOutputFd), never both. And because additionalFds is keyed by fd name, one descriptor can't be declared as both input and output.
So there's no way to run a request/response protocol between parent and child over a single inherited socket, e.g. a sidecar speaking a framed protocol on fd 3. Code that needs this has to call node:child_process spawn with stdio: [..., "pipe"] directly and drive child.stdio[3] itself. That means giving up ChildProcessSpawner and doing manual lifecycle, exit and error handling plus raw event listeners. The workaround of using two descriptors (fd 3 in, fd 4 out) changes the child's protocol contract and isn't always an option.
What is the feature you are proposing to solve the problem?
Add a duplex variant to AdditionalFdConfig, for example:
additionalFds: { fd3: { type: "duplex" } }
ChildProcessHandle would then expose both directions for that fd, e.g. a getDuplexFd(fd) that returns { stream, sink }. Alternatively, getInputFd and getOutputFd could both work on the same "duplex" descriptor.
What alternatives have you considered?
- Using
node:child_processspawndirectly and drivingchild.stdio[3]manually, which is what we do today. - Splitting the protocol across two unidirectional descriptors. This needs a change on the child side and doesn't match socket semantics such as half-close and shutdown.
Version: [email protected], @effect/[email protected].
- Ngôn ngữ chính
- TypeScript
- Star
- 16.7k
- Fork
- 808
- Merge trung bình
- 11 giờ 28 phút
- Pull request đã merge (30 ngày)
- 490
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Effect-TS/effect
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
Effect-TS/effect#8863 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BrowserWorkerRunner: port finalizer throws when the worker global has no close() (Bun)Có thể đã có người làm @santiago-ramos-02 đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Effect-TS/effect#8635 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support {self: this} for fnUntracedCó thể làm lại được @ArjunCodess đã nhận 20 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Effect-TS/effect#8101 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
add Effect-native McpClientCó thể đã có người làm @lloydrichards đã nhận 2 ngày trước. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Effect-TS/effect#8912 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Effect-TS/effect
Issue tương tự
-
Add: YRF Music NepalĐang mởstreams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
walletbeat/walletbeat#1558 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
hawk-digital-environments/HAWKI#438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GiganticMinecraft/seichi-portal-frontend#1165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày