Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Plack: Shutdown handler?

by jdrago999 (Pilgrim)
on Aug 10, 2011 at 20:51 UTC ( #919741=note: print w/replies, xml ) Need Help??

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 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://919741]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2020-07-03 20:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found