in reply to Signal handlers for POE::Component::*

Well, how about instantiating your own session and install the signal handler there? Who says you need to be able to do it within the confines of the slave component? With end developer POE::Components, it is generally assumed that you will be running it as part of a larger framework with other sessions doing other things, such as receiving events, etc. Remember that all of POE (for the most part, save Wheel::Run and PoCo::Child) runs inside a single perl interpreter. It doesn't really matter where you install the signal handler, so do it outside of the slave component.

-- NPEREZ
  • Comment on Re: Signal handlers for POE::Component::*

Replies are listed 'Best First'.
Re^2: Signal handlers for POE::Component::*
by pope (Friar) on Sep 26, 2005 at 07:30 UTC

    Yes we can create our own session and install the sig handler there, but then when the sig handler needs to tell the component: "Hey we've just got SIGHUP here, so please close and reopen your log file!", what to do?

    normally we'll do: $kernel->post("logger", "do_rotate"); but since there are no InlineStates and friends, we can't specify "do_rotate" and its callback.