class SignalManager

Properties

protected Repository $config
protected SafeCaller $safeCaller
protected bool $stopped
protected SignalRegistry $registry

Methods

__construct(Container $container)

Create a new signal manager instance.

void
listen(string $process)

Start listening for signals for the given process type.

void
stop()

Stop listening for signals in this process.

array
resolveHandlers(string $process)

Resolve the signal handlers for the given process type.

getQueue()

Build the priority queue of signal handler classes from config.

Details

at line 30
__construct(Container $container)

Create a new signal manager instance.

Parameters

Container $container

at line 43
void listen(string $process)

Start listening for signals for the given process type.

Boot-only. Call once for each process incarnation to avoid registering the configured handlers more than once.

Parameters

string $process

Return Value

void

at line 86
void stop()

Stop listening for signals in this process.

Parked native signal waits keep the Swoole reactor active. The deregister listener releases this manager's registrations at worker or server-process exit. A wait ends once all owners have released that signal.

Stopping is terminal for the current process incarnation and prevents subsequent signal listeners from starting.

Return Value

void

at line 98
protected array resolveHandlers(string $process)

Resolve the signal handlers for the given process type.

Parameters

string $process

Return Value

array

at line 150
protected SplPriorityQueue getQueue()

Build the priority queue of signal handler classes from config.

Return Value

SplPriorityQueue