Skip to main content

Crate folk_runtime_pipe

Crate folk_runtime_pipe 

Source
Expand description

§folk-runtime-pipe

Pipe-based PHP worker runtime for Folk.

Spawns each PHP worker via execve, connecting it to the Rust master through two Unix socketpairs:

  • FD 3 -> task channel (request/response RPC traffic)
  • FD 4 -> control channel (ready/idle/shutdown signals)

Uses pre_exec to set up file descriptors after fork but before exec.

§Platform

This crate is Unix-only (#![cfg(unix)]). It does not compile on Windows.

§Usage

use folk_runtime_pipe::{PipeConfig, PipeRuntime};

let runtime = PipeRuntime::new(PipeConfig {
    php: "php".into(),
    script: "vendor/bin/folk-worker".into(),
});

Re-exports§

pub use runtime::PipeConfig;
pub use runtime::PipeRuntime;

Modules§

handle
PipeWorkerHandle: wraps two Framed Unix streams for task+control.
runtime
PipeRuntime: spawns PHP workers via execve + Unix socketpairs.
socket
Safe wrapper around socketpair(2).
spawn
PHP worker process spawn with FD inheritance.