Lumaktaw patungo sa pangunahing content

PHPProcessManager

A PHP Process manager that maintains a pool of reusable PHP instances.

Instances are spawned on demand up to maxPhpInstances and reused across requests. The first instance spawned is the "primary" instance which contains the reference filesystem used by all other instances.

The semaphore controls how many requests can be processed concurrently. When all instances are busy, new requests wait in a queue until an instance becomes available or the timeout is reached.

Implements

Index

Constructors

constructor

Methods

[asyncDispose]

  • [asyncDispose](): Promise<void>
  • Returns Promise<void>

acquirePHPInstance

  • Acquire a PHP instance for processing a request.

    Returns an idle instance from the pool, or spawns a new one if the pool isn't at capacity. If all instances are busy, waits until one becomes available.

    @throws

    when the timeout is reached waiting for an available instance.


    Returns Promise<AcquiredPHP>

getPrimaryPhp

  • getPrimaryPhp(): Promise<PHP>
  • Get the primary PHP instance (the first one spawned). If no instance exists yet, one will be spawned and marked as idle.


    Returns Promise<PHP>