mirror of
https://github.com/danog/amp.git
synced 2025-01-22 21:31:18 +01:00
Merge pull request #84 from async-interop/signal_handlers_in_different_loops
Add a warning/implementation note about installing handlers for a same signal on different loops
This commit is contained in:
commit
6b1da28fb8
@ -199,6 +199,9 @@ final class Loop
|
|||||||
/**
|
/**
|
||||||
* Execute a callback when a signal is received.
|
* Execute a callback when a signal is received.
|
||||||
*
|
*
|
||||||
|
* WARNING: Installing a handler on the same signal on different scopes of event loop execution is
|
||||||
|
* undefined behavior and may break things arbitrarily.
|
||||||
|
*
|
||||||
* @param int $signo The signal number to monitor.
|
* @param int $signo The signal number to monitor.
|
||||||
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
|
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
|
||||||
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
|
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
|
||||||
|
@ -100,6 +100,10 @@ interface Driver
|
|||||||
*
|
*
|
||||||
* Multiple watchers on the same signal may be executed in any order.
|
* Multiple watchers on the same signal may be executed in any order.
|
||||||
*
|
*
|
||||||
|
* NOTE: Installing a same signal on different instances of this interface is deemed undefined behavior.
|
||||||
|
* Implementations may try to detect this, if possible, but are not required to.
|
||||||
|
* This is due to technical limitations of the signals being registered globally per process.
|
||||||
|
*
|
||||||
* @param int $signo The signal number to monitor.
|
* @param int $signo The signal number to monitor.
|
||||||
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
|
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
|
||||||
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
|
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user