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 26
static void add(string $name, Process $process)

Add a process to the collector under the given name.

Boot-only. 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 36
static array get(string $name)

Get all processes registered under the given name.

Parameters

string $name

Return Value

array

at line 46
static array all()

Get all collected processes.

Return Value

array

at line 58
static bool isEmpty()

Determine if the collector is empty.

Return Value

bool

at line 66
static void flushState()

Flush all static state.

Return Value

void