Skip to main content

Module runtime

Module runtime 

Source
Expand description

Extension runtime: workers via channels.

Two modes:

  • Single-worker (NTS): Main PHP thread is the worker. Pre-connected channels.
  • Multi-worker (ZTS): Additional worker threads spawned from Rust, each with its own PHP context via TSRM.

Uses std::sync::mpsc for task dispatch (worker thread blocks on recv). Uses tokio::sync::oneshot for reply (no blocking on tokio side).

Structs§

ChannelWorkerHandle
Handle connected to a worker via channels.
ExtensionRuntime
Extension runtime — manages worker channels and ZTS threads.
WorkerTxSide
Tx side of a worker channel pair (kept by the runtime/pool).