mirror of
https://github.com/danog/amp.git
synced 2024-11-27 12:35:02 +01:00
22 lines
424 B
PHP
Executable File
22 lines
424 B
PHP
Executable File
<?php
|
|
|
|
namespace Alert;
|
|
|
|
class ReactorFactory {
|
|
public function __invoke() {
|
|
return $this->select();
|
|
}
|
|
|
|
public function select() {
|
|
if (extension_loaded('uv')) {
|
|
$reactor = new UvReactor;
|
|
} elseif (extension_loaded('libevent')) {
|
|
$reactor = new LibeventReactor;
|
|
} else {
|
|
$reactor = new NativeReactor;
|
|
}
|
|
|
|
return $reactor;
|
|
}
|
|
}
|