Timer by itself blocks nothing, while sleep could do that; Although I think AE should prevent that as bad practice. To return/simulate delayed response, try
use AE; my $app = sub { return sub { my $r = shift; my $t; $t = AE::timer 60, 0, sub { my $writer = $r->([200, ['Content-Type' => 'text/plain'] ] +); $writer->write('Hello World'); $writer->close; undef $t; }; }; };
Also, please note, that not all servers are AE-compatible, i.e. they could use own loop mechanism, and there will be a problem with AE; e.g. starman.
Another source of problem with fork: do not ever use any loop-related code in child (directly or indirectly), i.e. do system/exec ASAP.
In reply to Re^3: AnyEvent code blocking Twiggy event loop
by basiliscos
in thread AnyEvent code blocking Twiggy event loop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |