Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 95179
Status: rejected
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: perry.sebastian [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: call forks from double test in if statement
Date: Tue, 29 Apr 2014 15:44:26 -0400
To: bug-POE [...] rt.cpan.org
From: Perry Sebastian <perry.sebastian [...] gmail.com>
Hi, I did not find a mention of this from a google search of POE bugs, so I'm assuming that it could be new. I came across an unusual feature/bug in POE. This code will generate 2 kernel calls for each loop. Both calls use the same hash pointer to the args. ... use Moose; use POE; ... foreach my $key (keys %$sessions) { my $args = $sessions->{$key}; foreach my $k (keys %$args) { print "show me .. k[$k] and v[".$args->{$k}."]\n"; } if(exists $args->{SESSION} and $args->{SESSION}) { print "Tracer statement...you are here...\n"; $_[KERNEL]->post( 'regAlias', 'REGISTER', $args ); } } Commenting out the if(exist... statement will generate 1 kernel call for each loop...which is the expected behavior.
Moving this text from the other ticket you opened: A follow up on the previous bug report. Although the IF statement appeared to generate (and suppress) the double call to a post session, the double call may be related to Moose-POE behaviour. It occurred from printing undefined variable values, too. I am calling POE sessions inside a [moose] object, and using wait (count) routines defined as object states. An attempt to retrieve a value from the object hash variable $_[OBJECT]->{ACTIVE_ALIASES} - using an unset key, also generated a double call to a post session. Properly setting the hash key, corrected the double call to one call per loop.
Sorry, but I'm also rejecting this one. If I understand the problem correctly, you fixed it by changing your data that the loop iterates through. That doesn't seem to be a "POE" problem. Please feel free to reopen this ticket if you think I'm misreading the problem. Be prepare to help me understand it better.