diotalevi has asked for the wisdom of the Perl Monks concerning the following question:
I read POE::Kernel and POE::Session and didn't see anything to query the kernel about the contents of the event queue. There is a regularly occurring event that only needs to occur when someone is connected to my POE::Component::TCP::Server. My OnConnect event should trigger the delayed event only if it isn't already in the queue. If I just use the normal delayed event dispatching methods then all I can do is clear or add to the delayed event queue.
If there isn't a way to get this from POE then I just have to keep track of whether I've sent a message from outside of POE. I've no problem doing this as an implementation but I don't think it is the right way to do it.
sub event_foo { $_[KERNEL]->delay_if_not_already_queued( $_[SESSION], ... ); } OR sub event_foo { $_[KERNEL]->delay( $_[SESSION], ... ) if not $_[KERNEL]->already_queued( 'event_foo' ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing POE's delayed event queue
by rcaputo (Chaplain) on Jul 06, 2004 at 17:02 UTC | |
by diotalevi (Canon) on Jul 06, 2004 at 17:14 UTC | |
|
Re: Accessing POE's delayed event queue
by RMGir (Prior) on Jul 06, 2004 at 16:37 UTC |