mirror of
https://github.com/danog/amp.git
synced 2025-01-22 13:21:16 +01:00
22 lines
341 B
PHP
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();
|
|
}
|
|
}
|