The problem is that I might need them later, only the garbage collector knows for sure. As an example, if I make the messaging session go away when the last subscription does, then code like this will fail:
sub handle_something {
my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];
$kernel->post(
$heap->{ 'messaging_session_id' },
'unsubscribe_all',
);
$kernel->post(
$heap->{ 'messaging_session_id' },
'subscribe' => '/some/message/queue',
);
}
POE's garbage collection includes a bunch of different things in determining if there is any work left to do (pending events, child sessions, handles in use, aliases in use, extra refs, external processes spawned) and basically what I want to do is tell it not to include this one handle in it's consideration, so that the messaging session alone can't keep the process alive, but I don't want to shut the messaging session down completely, because if any of those other things are generating events, then it may still be needed.
We're not surrounded, we're in a target-rich environment! |
---|