1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00

Drop Loop::supports

Redefine UnsupportedFeatureException to be only thrown if the system
doesn't support the feature. Drivers MUST support it if PCNTL or something
similar is available.
This commit is contained in:
Niklas Keller 2016-05-19 17:20:57 +02:00
parent a80e109027
commit 1f526a5cf0
3 changed files with 3 additions and 29 deletions

View File

@ -274,19 +274,6 @@ final class Loop
self::get()->setErrorHandler($callback); self::get()->setErrorHandler($callback);
} }
/**
* Check whether an optional feature is supported by the current event loop
* driver.
*
* @param int $feature Loop::FEATURE_* constant
*
* @return bool
*/
public static function supports($feature)
{
return self::get()->supports($feature);
}
/** /**
* Disable construction as this is a static class. * Disable construction as this is a static class.
*/ */

View File

@ -146,20 +146,6 @@ interface LoopDriver
*/ */
public function setErrorHandler(callable $callback = null); public function setErrorHandler(callable $callback = null);
/**
* Check whether an optional features is supported by this implementation
* and system.
*
* Example: If the implementation can handle signals using PCNTL, but the
* PCNTL extension is not available, the feature MUST NOT be marked as
* supported.
*
* @param int $feature FEATURE constant
*
* @return bool
*/
public function supports($feature);
/** /**
* Get the underlying loop handle. * Get the underlying loop handle.
* *

View File

@ -3,8 +3,9 @@
use Interop\Async; use Interop\Async;
/** /**
* Must be thrown if an optional feature is not supported by the current driver * Must be thrown if a feature is not supported by the system.
* or system. *
* This might happen if PCNTL is missing and the loop driver doesn't support another way to dispatch signals.
*/ */
class UnsupportedFeatureException extends \RuntimeException class UnsupportedFeatureException extends \RuntimeException
{ {