1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 21:31:18 +01:00
amp/lib/LoopFactory.php

22 lines
341 B
PHP
Raw Normal View History

2016-06-23 23:37:06 -05:00
<?php
namespace Amp\Loop;
use Interop\Async\Loop\DriverFactory;
/**
* Default loop factory for Amp.
*/
class LoopFactory implements DriverFactory {
/**
* {@inheritdoc}
*/
public function create() {
2016-06-26 17:35:25 +02:00
if (EvLoop::supported()) {
2016-06-23 23:37:06 -05:00
return new EvLoop();
}
return new NativeLoop();
}
}