in reply to Re: Plack: Shutdown handler?
in thread Plack: Shutdown handler?

Perhaps a flexible strategy would be to create a thread-safe queue of subroutine-references.

I like the idea, but I'm curious if there is something built-in to Plack itself. Something along the lines of a mod_perl2 `PerlShutdownHandler` thing. I don't see anything in the Plack docs but maybe I'm just looking wrong.

Replies are listed 'Best First'.
Re^3: Plack: Shutdown handler?
by locked_user sundialsvc4 (Abbot) on Aug 11, 2011 at 14:01 UTC

    I would not expect Plack to have such a thing.   The signal (whatever it is...) comes in once, and you are just carrying-out one or more actions in response to it.   (Hardware interrupt service routines in operating-systems routinely adopt a similar strategy, made necessary in part by the “sharing” of a limited number of IRQs, and in part by there simply being a variable number of “interested listeners.”)

    Packages like POE do have some logic along these lines ... whether to be literally-used or to be studied as a possible example.   These are the basis for “reactive,” “event-driven” systems which would treat “shutdown request” as just another type of event that can happen.   Food for thought, maybe.