Apache-Backend-POE

 view release on metacpan or  search on metacpan

examples/server.pl  view on Meta::CPAN


	my %out;
	foreach my $id (sort { $a <=> $b } keys %{$self->{map}}) {
		$out{$id} = "-";
		my $act;
		AGAIN:
		$act = $self->{map}->{$id};
#		print "\naction: $act for $id\n";
		if (defined($self->{decay}->{$id})) {
			my $d = $self->{decay}->{$id};
#			require Data::Dumper;
#			print "\n".Data::Dumper->Dump([$d]);
			if ($d->{delay} > 0) {
				if ($act eq 'delay') {
					if (exists($decay{$d->{delay}})) {
						$out{$id} = $decay{$d->{delay}};
					} else {
						$out{$id} = "[$d->{delay}]";
					}
				}
			} else {
				if ($d->{cmd} eq 'remove') {

lib/Apache/Backend/POE.pm  view on Meta::CPAN

		    and (($now - $LastPingTime{$dsn}) >= $PingTimeOut{$dsn})
		   ) ? 1 : 0;
#    print STDERR "$prefix need ping: ".($needping == 1 ? "yes" : "no")." \n" if $Apache::Backend::POE::DEBUG > 1;
    $LastPingTime{$dsn} = $now;

    # check first if there is already a object cached
    # if this is the case, possibly verify the object 
    # using the ping-method. Use eval for checking the connection 
    # handle in order to avoid problems (dying inside ping) when 
    # handle is invalid.
#	require Data::Dumper;
#	print STDERR Data::Dumper->Dump([\%Connected]);
	
    #if ($Connected{$Idx} and (!$needping or eval{$Connected{$Idx}->ping})) {
	$needping = 1;
	PING: {
		if ($Connected{$Idx}) {
			if ($needping) {
				print STDERR "$prefix going to ping\n" if $Apache::Backend::POE::DEBUG > 1;
				
				my $rt = eval{ $Connected{$Idx}->ping };
				



( run in 0.233 second using v1.01-cache-2.11-cpan-4d50c553e7e )