Skip to content

Commit

Permalink
improve Mojo::IOLoop to fall back to Mojo::Reactor::Poll if Perl has …
Browse files Browse the repository at this point in the history
…been compiled with fork emulation
  • Loading branch information
kraih committed Jun 9, 2016
1 parent 25877e8 commit 9435232
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,6 +1,8 @@

6.64 2016-06-07
6.64 2016-06-09
- Updated HTML5 entities in Mojo::Util.
- Improved Mojo::IOLoop to fall back to Mojo::Reactor::Poll if Perl has been
compiled with fork emulation.

6.63 2016-06-03
- Removed deprecated check method from Mojo::Server::Morbo.
Expand Down
4 changes: 3 additions & 1 deletion lib/Mojo/Reactor.pm
Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/Mojo/Reactor/EV.pm
Expand Up @@ -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 {
Expand Down
10 changes: 0 additions & 10 deletions lib/Mojolicious/Guides/FAQ.pod
Expand Up @@ -203,16 +203,6 @@ around 256KB by default, you can use the attribute
L<Mojo::Content/"max_buffer_size"> or C<MOJO_MAX_BUFFER_SIZE> environment
variable to change this value.

=head2 What does the error "EV does not work with ithreads" mean?

The L<Mojolicious> user agent and web servers are based on an event loop that
supports multiple reactor backends. One of these backends is L<EV>, it is very
fast and will be automatically used if possible. On Windows however, the
C<ithreads>-based C<fork()> emulation can interfere with it, and you may have to
use the C<MOJO_REACTOR> environment variable to enforce a more portable one.

MOJO_REACTOR=Mojo::Reactor::Poll

=head2 What does "Your secret passphrase needs to be changed" mean?

L<Mojolicious> uses secret passphrases for security features such as signed
Expand Down

0 comments on commit 9435232

Please sign in to comment.