mirror of
https://github.com/danog/amp.git
synced 2024-12-04 18:38:17 +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:
parent
30fc5464cc
commit
d03a2c14e6
@ -222,6 +222,15 @@ final class Loop
|
|||||||
return self::get()->supports($feature);
|
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.
|
* Disable construction as this is a static class.
|
||||||
*/
|
*/
|
||||||
|
@ -151,4 +151,13 @@ interface LoopDriver
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function supports($feature);
|
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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user