-
-
Save anonymous/0b964fd576a6b0f4c58257f353784321 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/Reactor.pm b/lib/Mojo/Reactor.pm | |
index ea11032..64d226b 100644 | |
--- a/lib/Mojo/Reactor.pm | |
+++ b/lib/Mojo/Reactor.pm | |
@@ -2,12 +2,14 @@ package Mojo::Reactor; | |
use Mojo::Base 'Mojo::EventEmitter'; | |
use Carp 'croak'; | |
+use Config; | |
use Mojo::Loader 'load_class'; | |
sub again { croak 'Method "again" not implemented by subclass' } | |
sub detect { | |
- my $try = $ENV{MOJO_REACTOR} || 'Mojo::Reactor::EV'; | |
+ my $default = 'Mojo::Reactor::' . ($Config{d_pseudofork} ? 'Poll' : 'EV'); | |
+ my $try = $ENV{MOJO_REACTOR} || $default; | |
return load_class($try) ? 'Mojo::Reactor::Poll' : $try; | |
} | |
diff --git a/lib/Mojo/Reactor/EV.pm b/lib/Mojo/Reactor/EV.pm | |
index 9cbc844..5d126ed 100644 | |
--- a/lib/Mojo/Reactor/EV.pm | |
+++ b/lib/Mojo/Reactor/EV.pm | |
@@ -6,8 +6,6 @@ use EV 4.0; | |
my $EV; | |
-sub CLONE { die "EV does not work with ithreads.\n" } | |
- | |
sub DESTROY { undef $EV } | |
sub again { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment