| Description: |
I've encountered a situation where it seems reasonable that
a snit object initiates its own destruction: The object manages
a channel and has an internal queue of messages to transmit.
A soft shutdown of the communication would then means that
the object owner stops calling it, but the object itself should
hang around for as long as it takes to work through the queue,
and only then destroy itself.
The catch is, I find nothing in the documentation about
whether an object method is allowed to call $self destroy,
although my gut feeling is that this might be asking for trouble.
For now, I'll probably do is as
after 0 [mymethod destroy]
instead, as I'm anyway running an event loop for the I/O, but
if there is some more elementary solution, then it would be
nice to learn about it.
|