Skip to main content

folk_runtime_fork/
lib.rs

1//! # `folk-runtime-fork`
2//!
3//! Fork-based PHP worker runtime for Folk: warm `OPcache` via prefork.
4//!
5//! A prefork master PHP process boots the framework once, then forks
6//! per-worker children that inherit its `OPcache`. Worker recycling
7//! re-uses the master (no re-bootstrap).
8//!
9//! ## Platform
10//!
11//! This crate is Unix-only (`#![cfg(unix)]`). `SCM_RIGHTS` FD passing
12//! is Linux primary, macOS experimental.
13//!
14//! ## Usage
15//!
16//! ```rust,no_run
17//! use folk_runtime_fork::{ForkConfig, ForkRuntime};
18//!
19//! # async fn example() -> anyhow::Result<()> {
20//! let runtime = ForkRuntime::new(ForkConfig {
21//!     php: "php".into(),
22//!     script: "vendor/bin/folk-worker".into(),
23//!     boot_timeout: std::time::Duration::from_secs(30),
24//! }).await?;
25//! # Ok(())
26//! # }
27//! ```
28
29#![cfg(unix)]
30
31pub mod handle;
32pub mod master;
33pub mod runtime;
34pub mod scm_rights;
35
36pub use runtime::{ForkConfig, ForkRuntime};