File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,32 @@ public static function setErrorHandler(callable $callback = null)
274
274
self ::get ()->setErrorHandler ($ callback );
275
275
}
276
276
277
+ /**
278
+ * Retrieve an associative array of information about the event loop driver.
279
+ *
280
+ * The returned array MUST contain the following data describing the driver's
281
+ * currently registered watchers:
282
+ *
283
+ * [
284
+ * "defer" => ["enabled" => int, "disabled" => int],
285
+ * "delay" => ["enabled" => int, "disabled" => int],
286
+ * "repeat" => ["enabled" => int, "disabled" => int],
287
+ * "on_readable" => ["enabled" => int, "disabled" => int],
288
+ * "on_writable" => ["enabled" => int, "disabled" => int],
289
+ * "on_signal" => ["enabled" => int, "disabled" => int],
290
+ * "watchers" => ["referenced" => int, "unreferenced" => int],
291
+ * ];
292
+ *
293
+ * Implementations MAY optionally add more information in the array but
294
+ * at minimum the above key => value format MUST always be provided.
295
+ *
296
+ * @return array
297
+ */
298
+ public static function info ()
299
+ {
300
+ return self ::get ()->info ();
301
+ }
302
+
277
303
/**
278
304
* Disable construction as this is a static class.
279
305
*/
Original file line number Diff line number Diff line change @@ -144,6 +144,29 @@ public function unreference($watcherId);
144
144
*/
145
145
public function setErrorHandler (callable $ callback = null );
146
146
147
+ /**
148
+ * Retrieve an associative array of information about the event loop driver.
149
+ *
150
+ * The returned array MUST contain the following data describing the driver's
151
+ * currently registered watchers:
152
+ *
153
+ * [
154
+ * "defer" => ["enabled" => int, "disabled" => int],
155
+ * "delay" => ["enabled" => int, "disabled" => int],
156
+ * "repeat" => ["enabled" => int, "disabled" => int],
157
+ * "on_readable" => ["enabled" => int, "disabled" => int],
158
+ * "on_writable" => ["enabled" => int, "disabled" => int],
159
+ * "on_signal" => ["enabled" => int, "disabled" => int],
160
+ * "watchers" => ["referenced" => int, "unreferenced" => int],
161
+ * ];
162
+ *
163
+ * Implementations MAY optionally add more information in the array but
164
+ * at minimum the above key => value format MUST always be provided.
165
+ *
166
+ * @return array
167
+ */
168
+ public function info ();
169
+
147
170
/**
148
171
* Get the underlying loop handle.
149
172
*
You can’t perform that action at this time.
0 commit comments