In the programs running under the Morbo (and Hypnotoad) server a call of exit()
is silently ignored and effectively works as a return from the callback. An END block fires as usually but a program itself never exits.
#!/usr/bin/perl
use Modern::Perl;
use Mojolicious::Lite;
END {
say "END block";
}
Mojo::IOLoop->timer(5 => sub {
say "Sleeping...";
sleep 15;
say "Before...";
exit(1);
say "Never seen";
});
app->start;
$ morbo test.pl
Server available at http://127.0.0.1:3000
Sleeping...
Before...
END block
^C