1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 18:07:57 +01:00

Add getLoopHandle() for accessing the underlying loop

These resources or objects may then be attributed to a specific extension via instanceof or get_resource_type() in implementations.

Fixes #16.
This commit is contained in:
Bob Weinand 2016-05-19 01:12:56 +02:00
parent 30fc5464cc
commit d03a2c14e6
2 changed files with 18 additions and 0 deletions

View File

@ -222,6 +222,15 @@ final class Loop
return self::get()->supports($feature);
}
/**
* Get the underlying loop handle.
*
* @return null|object|resource The loop handle the event loop operates on. Null if there is none.
*/
public static function getLoopHandle() {
return self::get()->getLoopHandle();
}
/**
* Disable construction as this is a static class.
*/

View File

@ -151,4 +151,13 @@ interface LoopDriver
* @return bool
*/
public function supports($feature);
/**
* Get the underlying loop handle.
*
* Example: the uv_loop resource for libuv or the EvLoop object for libev or null for a native driver
*
* @return null|object|resource The loop handle the event loop operates on. Null if there is none.
*/
public static function getLoopHandle();
}