mirror of
https://github.com/danog/amp.git
synced 2024-11-27 12:35:02 +01:00
commit
6c531f59d7
26
src/Loop.php
26
src/Loop.php
@ -274,6 +274,32 @@ final class Loop
|
||||
self::get()->setErrorHandler($callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an associative array of information about the event loop driver.
|
||||
*
|
||||
* The returned array MUST contain the following data describing the driver's
|
||||
* currently registered watchers:
|
||||
*
|
||||
* [
|
||||
* "defer" => ["enabled" => int, "disabled" => int],
|
||||
* "delay" => ["enabled" => int, "disabled" => int],
|
||||
* "repeat" => ["enabled" => int, "disabled" => int],
|
||||
* "on_readable" => ["enabled" => int, "disabled" => int],
|
||||
* "on_writable" => ["enabled" => int, "disabled" => int],
|
||||
* "on_signal" => ["enabled" => int, "disabled" => int],
|
||||
* "watchers" => ["referenced" => int, "unreferenced" => int],
|
||||
* ];
|
||||
*
|
||||
* Implementations MAY optionally add more information in the array but
|
||||
* at minimum the above key => value format MUST always be provided.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function info()
|
||||
{
|
||||
return self::get()->info();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable construction as this is a static class.
|
||||
*/
|
||||
|
@ -144,6 +144,29 @@ interface LoopDriver
|
||||
*/
|
||||
public function setErrorHandler(callable $callback = null);
|
||||
|
||||
/**
|
||||
* Retrieve an associative array of information about the event loop driver.
|
||||
*
|
||||
* The returned array MUST contain the following data describing the driver's
|
||||
* currently registered watchers:
|
||||
*
|
||||
* [
|
||||
* "defer" => ["enabled" => int, "disabled" => int],
|
||||
* "delay" => ["enabled" => int, "disabled" => int],
|
||||
* "repeat" => ["enabled" => int, "disabled" => int],
|
||||
* "on_readable" => ["enabled" => int, "disabled" => int],
|
||||
* "on_writable" => ["enabled" => int, "disabled" => int],
|
||||
* "on_signal" => ["enabled" => int, "disabled" => int],
|
||||
* "watchers" => ["referenced" => int, "unreferenced" => int],
|
||||
* ];
|
||||
*
|
||||
* Implementations MAY optionally add more information in the array but
|
||||
* at minimum the above key => value format MUST always be provided.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function info();
|
||||
|
||||
/**
|
||||
* Get the underlying loop handle.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user