Dear brother monks, I need some wisdom and enlightenment.

I've just started using POE since my project gets bigger and much more complex to manage. Things go fine until I need to install signal handlers for POE::Component::Server::HTTP.

I think the most logical place to install a signal handler for a POE component is through Started option which I found to be available for POE::Component:Server::TCP and POE::Component::Client::TCP. Since I couldn't find one for PoCo::Server::HTTP, I wrote my own HTTP server component which is much simpler but contains everything I need.

But then again I face the same problem when I want to add logging facility to the HTTP server component. I choose POE::Component::Logger since it looks like the easiest one to use. There is no such thing like Started option. Things are worse since there is no means to pass custom inline_states. I saw InlineStates option to those PoCo::*::TCP components.

My question is, what is the common way / best practice to install a signal handler for a component which doesn't have Started and InlineStates options?


In reply to Signal handlers for POE::Component::* by pope

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.