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
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,11 @@ 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 and before any other type of watcher. Order of enabling MUST be preserved when executing the callbacks.
31
+
* The deferred callable MUST be executed in the next tick of the event loop and before any other type of watcher.
32
+
* Order of enabling MUST be preserved when executing the callbacks.
32
33
*
33
-
* @param callable(string $watcherId, mixed $data) $callback The callback to defer. The $watcherId will be invalidated before the callback call.
34
+
* @param callable(string $watcherId, mixed $data) $callback The callback to defer. The $watcherId will be
35
+
* invalidated before the callback call.
34
36
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
35
37
*
36
38
* @return string An unique identifier that can be used to cancel, enable or disable the watcher.
@@ -40,10 +42,12 @@ public function defer(callable $callback, $data = null);
40
42
/**
41
43
* Delay the execution of a callback.
42
44
*
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 enabling.
45
+
* The delay is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which
46
+
* timers expire first, but timers with the same expiration time may be executed in any order.
44
47
*
45
48
* @param int $delay The amount of time, in milliseconds, to delay the execution for.
46
-
* @param callable(string $watcherId, mixed $data) $callback The callback to delay. The $watcherId will be invalidated before the callback call.
49
+
* @param callable(string $watcherId, mixed $data) $callback The callback to delay. The $watcherId will be
50
+
* invalidated before the callback call.
47
51
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
48
52
*
49
53
* @return string An unique identifier that can be used to cancel, enable or disable the watcher.
@@ -53,7 +57,8 @@ public function delay($delay, callable $callback, $data = null);
53
57
/**
54
58
* Repeatedly execute a callback.
55
59
*
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 enabling.
60
+
* The interval between executions is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be
61
+
* determined by which timers expire first, but timers with the same expiration time may be executed in any order.
57
62
* The first execution is scheduled after the first interval period.
58
63
*
59
64
* @param int $interval The time interval, in milliseconds, to wait between executions.
@@ -67,7 +72,7 @@ public function repeat($interval, callable $callback, $data = null);
67
72
/**
68
73
* Execute a callback when a stream resource becomes readable.
69
74
*
70
-
* In case of multiple watchers on a same stream, order of enabling MUST be preserved when executing the callbacks.
75
+
* Multiple watchers on the same stream may be executed in any order.
71
76
*
72
77
* @param resource $stream The stream to monitor.
73
78
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
@@ -80,7 +85,7 @@ public function onReadable($stream, callable $callback, $data = null);
80
85
/**
81
86
* Execute a callback when a stream resource becomes writable.
82
87
*
83
-
* In case of multiple watchers on a same stream, order of enabling MUST be preserved when executing the callbacks.
88
+
* Multiple watchers on the same stream may be executed in any order.
84
89
*
85
90
* @param resource $stream The stream to monitor.
86
91
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
@@ -93,7 +98,7 @@ public function onWritable($stream, callable $callback, $data = null);
93
98
/**
94
99
* Execute a callback when a signal is received.
95
100
*
96
-
* In case of multiple watchers on a same signal, order of enabling MUST be preserved when executing the callbacks.
101
+
* Multiple watchers on the same signal may be executed in any order.
97
102
*
98
103
* @param int $signo The signal number to monitor.
99
104
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.
@@ -108,7 +113,8 @@ public function onSignal($signo, callable $callback, $data = null);
108
113
/**
109
114
* Enable a watcher.
110
115
*
111
-
* Watchers (enabling or new watchers) MUST immediately be marked as enabled, but only be activated (i.e. callbacks can be called) right before the next tick. Callbacks of watchers MUST not be called in the tick they were enabled.
116
+
* Watchers (enabling or new watchers) MUST immediately be marked as enabled, but only be activated (i.e. callbacks
117
+
* can be called) right before the next tick. Callbacks of watchers MUST not be called in the tick they were enabled.
112
118
*
113
119
* @param string $watcherId The watcher identifier.
114
120
*
@@ -198,7 +204,8 @@ public function fetchState($key);
198
204
*
199
205
* Subsequent calls to this method will overwrite the previous handler.
200
206
*
201
-
* @param callable(\Throwable|\Exception $error)|null $callback The callback to execute; null will clear the current handler.
207
+
* @param callable(\Throwable|\Exception $error)|null $callback The callback to execute; null will clear the current
0 commit comments