mirror of
https://github.com/danog/amp.git
synced 2025-01-22 05:11:42 +01:00
Update to event-loop 0.5.0
This commit is contained in:
parent
a47fc2bc01
commit
568183b261
@ -11,14 +11,14 @@
|
||||
"homepage": "http://amphp.org",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"async-interop/event-loop": "0.4"
|
||||
"async-interop/event-loop": "0.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"async-interop/event-loop-test": "dev-master",
|
||||
"async-interop/event-loop-test": "^0.5",
|
||||
"friendsofphp/php-cs-fixer": "~1.9"
|
||||
},
|
||||
"provide": {
|
||||
"async-interop/event-loop-implementation": "^0.4"
|
||||
"async-interop/event-loop-implementation": "^0.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Loop;
|
||||
|
||||
use Amp\Loop\Internal\Watcher;
|
||||
use Interop\Async\Loop\Driver;
|
||||
use Interop\Async\Loop\InvalidWatcherException;
|
||||
use AsyncInterop\Loop\Driver;
|
||||
use AsyncInterop\Loop\InvalidWatcherException;
|
||||
|
||||
abstract class Loop extends Driver {
|
||||
const MILLISEC_PER_SEC = 1e3;
|
||||
@ -245,7 +245,7 @@ abstract class Loop extends Driver {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws \Interop\Async\Loop\UnsupportedFeatureException If the pcntl extension is not available.
|
||||
* @throws \AsyncInterop\Loop\UnsupportedFeatureException If the pcntl extension is not available.
|
||||
* @throws \RuntimeException If creating the backend signal handler fails.
|
||||
*/
|
||||
public function onSignal($signo, callable $callback, $data = null) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Amp\Loop;
|
||||
|
||||
use Interop\Async\Loop\DriverFactory;
|
||||
use AsyncInterop\Loop\DriverFactory;
|
||||
|
||||
/**
|
||||
* Default loop factory for Amp.
|
||||
@ -15,11 +15,11 @@ class LoopFactory implements DriverFactory {
|
||||
if (UvLoop::supported()) {
|
||||
return new UvLoop;
|
||||
}
|
||||
|
||||
|
||||
if (EvLoop::supported()) {
|
||||
return new EvLoop;
|
||||
}
|
||||
|
||||
|
||||
if (EventLoop::supported()) {
|
||||
return new EventLoop;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Amp\Loop;
|
||||
|
||||
use Amp\Loop\Internal\Watcher;
|
||||
use Interop\Async\Loop\UnsupportedFeatureException;
|
||||
use AsyncInterop\Loop\UnsupportedFeatureException;
|
||||
|
||||
class NativeLoop extends Loop {
|
||||
/**
|
||||
@ -183,7 +183,7 @@ class NativeLoop extends Loop {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws \Interop\Async\Loop\UnsupportedFeatureException If the pcntl extension is not available.
|
||||
* @throws \AsyncInterop\Loop\UnsupportedFeatureException If the pcntl extension is not available.
|
||||
* @throws \RuntimeException If creating the backend signal handler fails.
|
||||
*/
|
||||
public function onSignal($signo, callable $callback, $data = null) {
|
||||
@ -275,7 +275,7 @@ class NativeLoop extends Loop {
|
||||
default: throw new \DomainException("Unknown watcher type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $signo
|
||||
*/
|
||||
@ -284,7 +284,7 @@ class NativeLoop extends Loop {
|
||||
if (!isset($this->signalWatchers[$signo][$watcher->id])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$callback = $watcher->callback;
|
||||
$callback($watcher->id, $signo, $watcher->data);
|
||||
}
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
namespace Amp\Loop;
|
||||
|
||||
use Interop\Async\Loop;
|
||||
use AsyncInterop\Loop;
|
||||
|
||||
Loop::setFactory(new LoopFactory());
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Test\Loop;
|
||||
|
||||
use Amp\Loop\EvLoop;
|
||||
use Interop\Async\Loop\DriverFactory;
|
||||
use Interop\Async\Loop\Test;
|
||||
use AsyncInterop\Loop\DriverFactory;
|
||||
use AsyncInterop\Loop\Test;
|
||||
|
||||
/**
|
||||
* @requires extension ev
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Test\Loop;
|
||||
|
||||
use Amp\Loop\EventLoop;
|
||||
use Interop\Async\Loop\DriverFactory;
|
||||
use Interop\Async\Loop\Test;
|
||||
use AsyncInterop\Loop\DriverFactory;
|
||||
use AsyncInterop\Loop\Test;
|
||||
|
||||
/**
|
||||
* @requires extension event
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Test\Loop;
|
||||
|
||||
use Amp\Loop\NativeLoop;
|
||||
use Interop\Async\Loop\DriverFactory;
|
||||
use Interop\Async\Loop\Test;
|
||||
use AsyncInterop\Loop\DriverFactory;
|
||||
use AsyncInterop\Loop\Test;
|
||||
|
||||
class NativeLoopTest extends Test {
|
||||
public function getFactory() {
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Amp\Test\Loop;
|
||||
|
||||
use Amp\Loop\UvLoop;
|
||||
use Interop\Async\Loop\DriverFactory;
|
||||
use Interop\Async\Loop\Test;
|
||||
use AsyncInterop\Loop\DriverFactory;
|
||||
use AsyncInterop\Loop\Test;
|
||||
|
||||
/**
|
||||
* @requires extension uv
|
||||
|
Loading…
x
Reference in New Issue
Block a user