mirror of
https://github.com/danog/amp.git
synced 2024-12-02 09:27:46 +01:00
Only poll again on UV_EAGAIN
This commit is contained in:
parent
3f1f9f41ca
commit
51ab8cb134
@ -42,11 +42,15 @@ class UvDriver extends Driver {
|
|||||||
case 0: // OK
|
case 0: // OK
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// If $status is a severe error, disable all related watchers and notify the loop error handler.
|
case \UV::EAGAIN: // Resource temporarily unavailable.
|
||||||
case \UV::EACCES:
|
$flags = 0;
|
||||||
case \UV::EBADF:
|
foreach ($this->watchers[(int) $event] as $watcher) {
|
||||||
case \UV::EINVAL:
|
$flags |= $watcher->enabled ? $watcher->type : 0;
|
||||||
case \UV::ENOTSOCK:
|
}
|
||||||
|
\uv_poll_start($event, $flags, $this->ioCallback); // Poll must be reactivated.
|
||||||
|
return;
|
||||||
|
|
||||||
|
default: // Disable all related watchers and notify the loop error handler.
|
||||||
foreach ($watchers as $watcher) {
|
foreach ($watchers as $watcher) {
|
||||||
$this->disable($watcher);
|
$this->disable($watcher);
|
||||||
}
|
}
|
||||||
@ -54,9 +58,6 @@ class UvDriver extends Driver {
|
|||||||
\sprintf("UV_%s: %s", \uv_err_name($status), \ucfirst(\uv_strerror($status)))
|
\sprintf("UV_%s: %s", \uv_err_name($status), \ucfirst(\uv_strerror($status)))
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default: // Ignore other (probably) trivial warnings and continuing polling.
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($watchers as $watcher) {
|
foreach ($watchers as $watcher) {
|
||||||
|
Loading…
Reference in New Issue
Block a user