@@ -158,8 +158,31 @@ A `stream_select()` based event loop.
158
158
159
159
This uses the [ ` stream_select() ` ] ( http://php.net/manual/en/function.stream-select.php )
160
160
function and is the only implementation which works out of the box with PHP.
161
- It does a simple ` select ` system call.
162
- It's not the most performant of loops, but still does the job quite well.
161
+
162
+ This event loop works out of the box on PHP 5.4 through PHP 7+ and HHVM.
163
+ This means that no installation is required and this library works on all
164
+ platforms and supported PHP versions.
165
+ Accordingly, the [ ` Factory ` ] ( #factory ) will use this event loop by default if
166
+ you do not install any of the event loop extensions listed below.
167
+
168
+ Under the hood, it does a simple ` select ` system call.
169
+ This system call is limited to the maximum file descriptor number of
170
+ ` FD_SETSIZE ` (platform dependent, commonly 1024) and scales with ` O(m) `
171
+ (` m ` being the maximum file descriptor number passed).
172
+ This means that you may run into issues when handling thousands of streams
173
+ concurrently and you may want to look into using one of the alternative
174
+ event loop implementations listed below in this case.
175
+ If your use case is among the many common use cases that involve handling only
176
+ dozens or a few hundred streams at once, then this event loop implementation
177
+ performs really well.
178
+
179
+ If you want to use signal handling (see also [ ` addSignal() ` ] ( #addsignal ) below),
180
+ this event loop implementation requires ` ext-pcntl ` .
181
+ This extension is only available for Unix-like platforms and does not support
182
+ Windows.
183
+ It is commonly installed as part of many PHP distributions.
184
+ If this extension is missing (or you're running on Windows), signal handling is
185
+ not supported and throws a ` BadMethodCallException ` instead.
163
186
164
187
#### LibEventLoop
165
188
@@ -168,20 +191,33 @@ An `ext-libevent` based event loop.
168
191
This uses the [ ` libevent ` PECL extension] ( https://pecl.php.net/package/libevent ) .
169
192
` libevent ` itself supports a number of system-specific backends (epoll, kqueue).
170
193
194
+ This event loop does only work with PHP 5.
195
+ An [ unofficial update] ( https://github.com/php/pecl-event-libevent/pull/2 ) for
196
+ PHP 7 does exist, but it is known to cause regular crashes due to ` SEGFAULT ` s.
197
+ To reiterate: Using this event loop on PHP 7 is not recommended.
198
+ Accordingly, the [ ` Factory ` ] ( #factory ) will not try to use this event loop on
199
+ PHP 7.
200
+
171
201
#### LibEvLoop
172
202
173
203
An ` ext-libev ` based event loop.
174
204
175
205
This uses an [ unofficial ` libev ` extension] ( https://github.com/m4rw3r/php-libev ) .
176
206
It supports the same backends as libevent.
177
207
208
+ This loop does only work with PHP 5.
209
+ An update for PHP 7 is [ unlikely] ( https://github.com/m4rw3r/php-libev/issues/8 )
210
+ to happen any time soon.
211
+
178
212
#### ExtEventLoop
179
213
180
214
An ` ext-event ` based event loop.
181
215
182
216
This uses the [ ` event ` PECL extension] ( https://pecl.php.net/package/event ) .
183
217
It supports the same backends as libevent.
184
218
219
+ This loop is known to work with PHP 5.4 through PHP 7+.
220
+
185
221
### LoopInterface
186
222
187
223
#### addTimer()
0 commit comments