diff --git a/src/Loop.php b/src/Loop.php index c62cf56..da06384 100644 --- a/src/Loop.php +++ b/src/Loop.php @@ -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. */ diff --git a/src/LoopDriver.php b/src/LoopDriver.php index 757d8ee..2721543 100644 --- a/src/LoopDriver.php +++ b/src/LoopDriver.php @@ -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(); }