mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Miscellaneous reactor cleanup
This commit is contained in:
parent
288530d296
commit
10037fe859
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Amp;
|
||||
|
||||
class LibeventReactor implements SignalReactor {
|
||||
class LibeventReactor implements ExtensionReactor {
|
||||
private $base;
|
||||
private $watchers = [];
|
||||
private $immediates = [];
|
||||
@ -438,8 +438,8 @@ class LibeventReactor implements SignalReactor {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function onError(callable $onErrorCallback) {
|
||||
$this->onError = $onErrorCallback;
|
||||
public function onError(callable $callback) {
|
||||
$this->onError = $callback;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Amp;
|
||||
|
||||
class UvReactor implements SignalReactor {
|
||||
class UvReactor implements ExtensionReactor {
|
||||
private $loop;
|
||||
private $lastWatcherId = "a";
|
||||
private $watchers;
|
||||
@ -218,7 +218,7 @@ class UvReactor implements SignalReactor {
|
||||
return function() use ($watcher, $callback) {
|
||||
try {
|
||||
$watcherId = $watcher->id;
|
||||
$result = call_user_func($callback, $this, $watcherId, $watcher->callbackData);
|
||||
$result = \call_user_func($callback, $this, $watcherId, $watcher->callbackData);
|
||||
if ($result instanceof \Generator) {
|
||||
resolve($result, $this)->when($this->onCoroutineResolution);
|
||||
}
|
||||
@ -630,8 +630,8 @@ class UvReactor implements SignalReactor {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function onError(callable $func) {
|
||||
$this->onError = $func;
|
||||
public function onError(callable $callback) {
|
||||
$this->onError = $callback;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
|
@ -6,11 +6,11 @@ use Amp\UvReactor;
|
||||
|
||||
class UvReactorTest extends ReactorTest {
|
||||
protected function getReactor() {
|
||||
if (extension_loaded('uv')) {
|
||||
return new UvReactor($new = TRUE);
|
||||
if (extension_loaded("uv")) {
|
||||
return new UvReactor();
|
||||
} else {
|
||||
$this->markTestSkipped(
|
||||
'php-uv extension not loaded'
|
||||
"php-uv extension not loaded"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user