Skip to content

Commit

Permalink
Lower ext-uv factory listing
Browse files Browse the repository at this point in the history
This ties in directly with reactphp/filesystem#112 where if both ext-eio and ext-uv are present ext-uv interferes with ext-eio. By putting it lower in the factory construction method it will favor ext-eio over ext-uv for filesystem I/O is there is also a another event loop extension present.
  • Loading branch information
WyriHaximus committed Nov 8, 2022
1 parent 3992edd commit e9eaf38
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public static function create()
private static function construct()
{
// @codeCoverageIgnoreStart
if (\function_exists('uv_loop_new')) {
// only use ext-uv on PHP 7
return new ExtUvLoop();
}

if (\class_exists('libev\EventLoop', false)) {
return new ExtLibevLoop();
}
Expand All @@ -64,6 +59,10 @@ private static function construct()
return new ExtEventLoop();
}

if (\function_exists('uv_loop_new')) {
return new ExtUvLoop();
}

if (\function_exists('event_base_new') && \PHP_MAJOR_VERSION === 5) {
// only use ext-libevent on PHP 5 for now
return new ExtLibeventLoop();
Expand Down

0 comments on commit e9eaf38

Please sign in to comment.