-
Hi! For example, we have this code package Awesome;
use Mojo::Base 'Mojolicious';
sub startup {
....
$app->hook('around_dispatch' => sub {
eval {
$next->();
$_->() for (get_request_post_hooks()->@*);
};
}
} what event will happen earlier - subs from get_request_post_hooks executed or answer rendered in browser? |
Beta Was this translation helpful? Give feedback.
Answered by
elcamlost
Dec 29, 2020
Replies: 1 comment
-
I added in request_post_hooks this sub sub { sleep 10 } and now every request renders at least 10 seconds. So, the answer is "get_request_post_hooks executed first and then answer will be rendered to client". |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
elcamlost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added in request_post_hooks this sub
and now every request renders at least 10 seconds. So, the answer is "get_request_post_hooks executed first and then answer will be rendered to client".