Skip to main content

folk_runtime_pipe/
lib.rs

1//! # `folk-runtime-pipe`
2//!
3//! Pipe-based PHP worker runtime for Folk.
4//!
5//! Spawns each PHP worker via `execve`, connecting it to the Rust master
6//! through two Unix socketpairs:
7//!
8//! - FD 3 -> task channel (request/response RPC traffic)
9//! - FD 4 -> control channel (ready/idle/shutdown signals)
10//!
11//! Uses `pre_exec` to set up file descriptors after fork but before exec.
12//!
13//! ## Platform
14//!
15//! This crate is Unix-only (`#![cfg(unix)]`). It does not compile on Windows.
16//!
17//! ## Usage
18//!
19//! ```rust,no_run
20//! use folk_runtime_pipe::{PipeConfig, PipeRuntime};
21//!
22//! let runtime = PipeRuntime::new(PipeConfig {
23//!     php: "php".into(),
24//!     script: "vendor/bin/folk-worker".into(),
25//! });
26//! ```
27
28#![cfg(unix)]
29
30pub mod handle;
31pub mod runtime;
32pub mod socket;
33pub mod spawn;
34
35pub use runtime::{PipeConfig, PipeRuntime};