You can use amphp/react-adapter
+ amphp/amp
, which will give you an ev
based implementation – if ev
is installed – that is fully compatible with ReactPHP's LoopInterface
.
$driver = (new Amp\Loop\DriverFactory)->create();
$loop = new Amp\ReactAdapter\ReactAdapter($driver);
// $loop is now a ReactPHP compatible driver based on ext-ev
If you don't want the automatic driver selection based on the available extensions, you can also instantiate a driver on your own using $driver = new Amp\Loop\EvDriver;
.