On Mon, Dec 24, 2001 at 03:01:57PM -0500, Jon Oringer wrote:
> This is a simple question, yet I have no idea why it isn't working.
> Since I set the alias, why does _stop get reached?
> Since I alias_set, it should still wait for things to do - without
> exiting.
> It should be deamonized, no?

[sample program removed]

That's a good question.

The short answer:

A program will exit anyway if it's being kept running only by aliases.

The detailed answer:

Aliases are one of the things that keep sessions alive.  POE assumes
that aliased sessions will be called upon by other sessions to perform
services.  The aliased sessions are essentially daemons within the
larger program, and the other sessions act as clients.

If this were the whole story, programs that ran out of clients would
hang, forever waiting for new requests that never came.

POE recognizes these situations.  Rather than leave programs hanging,
it tries to wake up their remaining daemons.  If the daemons don't
wake up, POE stops them outright.

POE tries to wake up idle daemons by dispatching IDLE signals to them.
All the daemons are allowed to live if at least one of them wakes up
in response to an IDLE signal.

If no daemons wake up, however, they all receive lethal ZOMBIE signals
and are stopped unconditionally.  POE exits cleanly once the last
daemon stops.

A list of things that keep sessions alive can be found at
http://poe.perl.org/?POE_FAQ/Why_do_my_sessions_not_stop_on_their_own

-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net

Reply via email to