Skip to main content

Module runtime

Module runtime 

Source
Expand description

Abstraction over how PHP workers are spawned.

WorkerPool does not know what a PHP process is. It asks the Runtime to spawn a worker; the runtime returns a WorkerHandle which gives the pool ways to send/receive frames and to terminate the worker.

folk-runtime-pipe (phase 4) implements this trait by spawning real PHP processes via execve. folk-runtime-fork (phase 10) implements it via prefork. Tests use MockRuntime below.

Structs§

MockRuntime
In-memory runtime used in tests. Each spawned worker is a MockWorker that returns canned responses for any task-channel request.
MockWorker
In-memory worker used by MockRuntime.

Traits§

Runtime
Spawns workers per a runtime-specific strategy.
WorkerHandle
A handle to a spawned worker.