File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,18 @@ public static function unreference($eventIdentifier)
210
210
self ::get ()->unreference ($ eventIdentifier );
211
211
}
212
212
213
+ /**
214
+ * Check whether an optional feature is supported by the current event loop
215
+ * driver.
216
+ *
217
+ * @param int $feature Loop::FEATURE_* constant
218
+ *
219
+ * @return bool
220
+ */
221
+ public static function supports ($ feature ) {
222
+ return self ::get ()->supports ($ feature );
223
+ }
224
+
213
225
/**
214
226
* Disable construction as this is a static class.
215
227
*/
Original file line number Diff line number Diff line change 4
4
5
5
interface LoopDriver
6
6
{
7
+ const FEATURE_SIGNAL_HANDLING = 0b001 ;
8
+
7
9
/**
8
10
* Start the event loop.
9
11
*
@@ -135,4 +137,18 @@ public function reference($eventIdentifier);
135
137
* @return void
136
138
*/
137
139
public function unreference ($ eventIdentifier );
140
+
141
+ /**
142
+ * Check whether an optional features is supported by this implementation
143
+ * and system.
144
+ *
145
+ * Example: If the implementation can handle signals using PCNTL, but the
146
+ * PCNTL extension is not available, the feature MUST NOT be marked as
147
+ * supported.
148
+ *
149
+ * @param int $feature FEATURE constant
150
+ *
151
+ * @return bool
152
+ */
153
+ public function supports ($ feature );
138
154
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Interop \Async \EventLoop ;
4
+
5
+ /**
6
+ * Must be thrown if an optional feature is not supported by the current driver
7
+ * or system.
8
+ */
9
+ class UnsupportedFeatureException extends \RuntimeException { }
You can’t perform that action at this time.
0 commit comments