in reply to Dancer2 start/stop hooks

I don't know about hooks, but your app could perhaps utilize a BEGIN{} and END{} block to log such times. The former will log during compile (ie. startup), and the latter will log after the program has finished and just before exit.

Replies are listed 'Best First'.
Re^2: Dancer2 start/stop hooks
by morgon (Priest) on May 18, 2018 at 15:49 UTC
    Yes, I've been thinking about that and it would probably work for my case, but in the general case (I think) a dancer app may fork several workers and that would result in serval END-blocks being fired for one run of dancer.

      You could get the PID in the script before you dance; and use it as a conditional in the END block.


      The way forward always starts with a minimal test.