You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Loop/Driver.php
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ public function stop();
28
28
/**
29
29
* Defer the execution of a callback.
30
30
*
31
-
* The deferred callable MUST be executed in the next tick of the event loop.
31
+
* The deferred callable MUST be executed in the next tick of the event loop and before any other type of watcher. Order of definition MUST be preserved when executing the callbacks.
32
32
*
33
33
* @param callable(string $watcherId, mixed $data) $callback The callback to defer. The $watcherId will be invalidated before the callback call.
34
34
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
@@ -40,7 +40,7 @@ public function defer(callable $callback, $data = null);
40
40
/**
41
41
* Delay the execution of a callback.
42
42
*
43
-
* The delay is a minimum and approximate, accuracy is not guaranteed.
43
+
* The delay is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of definition.
44
44
*
45
45
* @param int $delay The amount of time, in milliseconds, to delay the execution for.
46
46
* @param callable(string $watcherId, mixed $data) $callback The callback to delay. The $watcherId will be invalidated before the callback call.
@@ -53,7 +53,7 @@ public function delay($delay, callable $callback, $data = null);
53
53
/**
54
54
* Repeatedly execute a callback.
55
55
*
56
-
* The interval between executions is a minimum and approximate, accuracy is not guaranteed.
56
+
* The interval between executions is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of definition.
57
57
* The first execution is scheduled after the first interval period.
58
58
*
59
59
* @param int $interval The time interval, in milliseconds, to wait between executions.
@@ -67,6 +67,8 @@ public function repeat($interval, callable $callback, $data = null);
67
67
/**
68
68
* Execute a callback when a stream resource becomes readable.
69
69
*
70
+
* In case of multiple watchers on a same stream, order of definition MUST be preserved when executing the callbacks.
71
+
*
70
72
* @param resource $stream The stream to monitor.
71
73
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
72
74
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
@@ -78,6 +80,8 @@ public function onReadable($stream, callable $callback, $data = null);
78
80
/**
79
81
* Execute a callback when a stream resource becomes writable.
80
82
*
83
+
* In case of multiple watchers on a same stream, order of definition MUST be preserved when executing the callbacks.
84
+
*
81
85
* @param resource $stream The stream to monitor.
82
86
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
83
87
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
@@ -89,6 +93,8 @@ public function onWritable($stream, callable $callback, $data = null);
89
93
/**
90
94
* Execute a callback when a signal is received.
91
95
*
96
+
* In case of multiple watchers on a same signal, order of definition MUST be preserved when executing the callbacks.
97
+
*
92
98
* @param int $signo The signal number to monitor.
93
99
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
94
100
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
0 commit comments