Author: spadkins
Date: Fri Feb  1 08:22:37 2013
New Revision: 15568

Modified:
   p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm
   p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm

Log:
Update maintains accuracy in the num_async_event internal counters (both 
general and node / destination specific) when an event is canceled or aborted.

Modified: p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm   (original)
+++ p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm   Fri Feb  1 
08:22:37 2013
@@ -261,6 +261,7 @@
             }
 
             ### Remove from pending
+            $self->{num_async_events}--;
             delete $self->{running_async_event}{$pid};
             $self->log({level=>3},"poe_cancel_async_event FOUND RUNNING 
event_token=[$event_token] pid=[$pid]\n");
 

Modified: p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm        (original)
+++ p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm        Fri Feb  1 
08:22:37 2013
@@ -797,7 +797,10 @@
     my $pending_async_events = $self->{pending_async_events};
     my $async_event = $running_async_event->{$runtime_event_token};
     if ($async_event) {
+        my ($event, $callback_event) = @$async_event;
+        my $destination = $event->{destination} || "local";
         $self->{num_async_events}--;
+        $self->{node}{$destination}{num_async_events}--;
         delete $self->{running_async_event}{$runtime_event_token};
         $self->_abort_running_async_event($runtime_event_token, @$async_event);
     }

Reply via email to