kraih/mojo — Issue #278: IO Loop is blocked when same URL parallel requests is received.
Author: yuki-kimoto
Created: 2012-01-31 12:33:49+00:00
State: open

I want to receive parallel request. so i write the following code(1) using AynyEvent and EV.
but If same URL parallel request is received, io loop is blocked, for example access URL '/sleep1 after '/sleep1' access.
10 second is needed.

'/sleep1' and '/sleep2 parallel request is processed well.
5 second is needed.

but '/sleep1' and '/sleep1' parallel request is blocked.
10 second is needed.

Is this my programming issue or Mojolicious issue or AnyEvent issue?

(1)------------------------------------------------

use Mojolicious::Lite;
use AnyEvent;
use EV;

get '/sleep1' => sub {
my $self = shift;

my $w;
$self->render_later;
$w = AE::timer 5, 0, sub {
$self->render(text => 'Delayed by 5 seconds!');
undef $w;
};
};

get '/sleep2' => sub {
my $self = shift;

my $w;
$self->render_later;
$w = AE::timer 5, 0, sub {
$self->render(text => 'Delayed by 5 seconds!');
undef $w;
};
};

app->start;

-----------------------------------------------

I execute this command.

morbo script.pl

on Mojolicious 2.46, AnyEvent 6.13 , CentOS 5 .5