1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 13:21:16 +01:00
amp/lib/LoopFactory.php
2016-06-26 17:35:25 +02:00

22 lines
341 B
PHP

<?php
namespace Amp\Loop;
use Interop\Async\Loop\DriverFactory;
/**
* Default loop factory for Amp.
*/
class LoopFactory implements DriverFactory {
/**
* {@inheritdoc}
*/
public function create() {
if (EvLoop::supported()) {
return new EvLoop();
}
return new NativeLoop();
}
}