class ProcessCollector

Collect coroutine-enabled Swoole processes by name.

Properties

static protected Process[]> $processes

Methods

static void
add(string $name, Process $process)

Add a process to the collector under the given name.

static array
get(string $name)

Get all processes registered under the given name.

static array
all()

Get all collected processes.

static bool
isEmpty()

Determine if the collector is empty.

static void
flushState()

Flush all static state.

Details

at line 27
static void add(string $name, Process $process)

Add a process to the collector under the given name.

The collector is process-wide static state populated during server boot; runtime use mutates state shared across every coroutine in the worker.

Parameters

string $name
Process $process

Return Value

void

at line 38
static array get(string $name)

Get all processes registered under the given name.

Parameters

string $name

Return Value

array

at line 48
static array all()

Get all collected processes.

Return Value

array

at line 60
static bool isEmpty()

Determine if the collector is empty.

Return Value

bool

at line 68
static void flushState()

Flush all static state.

Return Value

void