Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Telling POE to ignore a filehandle for garbage collection purposes?

by jasonk (Parson)
on Mar 18, 2008 at 01:08 UTC ( [id://674688]=note: print w/replies, xml ) Need Help??


in reply to Re: Telling POE to ignore a filehandle for garbage collection purposes?
in thread Telling POE to ignore a filehandle for garbage collection purposes?

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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-19 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found