Branch Coverage

blib/lib/Gearman/Server.pm
Criterion Covered Total %
branch 17 80 21.2


line true false branch
118 0 9 ref $class ? :
141 2 7 if (defined $wakeup)
142 1 1 if $wakeup < 0 and $wakeup != -1
148 2 6 if (defined $wakeup_delay)
149 1 1 if $wakeup_delay < 0 and $wakeup_delay != -1
154 1 6 if %opts
189 0 7 if keys %opts
193 1 6 $local_addr ? :
0 7 unless my $ssock = 'IO::Socket::INET'->new('LocalPort', $portnum, 'Type', 1, 'Proto', 6, 'Blocking', 0, 'Reuse', 1, 'Listen', 1024, $local_addr ? ('LocalAddr', $local_addr) : ())
260 0 0 unless socketpair $csock, $psock, 1, 1, 0
293 0 0 unless socketpair $csock, $psock, 1, 1, 0
300 0 0 unless (defined $pid)
306 0 0 unless ($pid)
310 0 0 unless open STDIN, '<&', $psock
312 0 0 unless open STDOUT, '>&', $psock
314 0 0 if (UNIVERSAL::isa($prog, 'CODE'))
335 0 0 wantarray ? :
346 0 0 if (defined(my $max_queue_size = $self->{'max_queue'}{$job->{'func'}}))
359 0 0 if ($highpri) { }
376 0 0 if (my $existing_timer = delete $self->{'wakeup_timers'}{$func})
380 0 0 unless $self->_wake_up_some($func)
385 0 0 if $delay == -1
388 0 0 if $self->{'wakeup'} == 0
396 0 0 unless $self->{'job_queue'}{$func}
0 0 unless @{[] unless $self->{'job_queue'}{$func};}
407 0 0 unless my $sleepmap = $self->{'sleepers'}{$func}
408 0 0 unless my $sleeporder = $self->{'sleepers_list'}{$func}
416 0 0 if $c->{'closed'} or not $c->{'sleeping'}
417 0 0 if ($max-- <= 0)
442 0 0 if ($self->{'job_queue'}{$cd})
451 0 0 if $count >= 2
459 0 0 if ($jobs_done) { }
506 0 0 if (my Gearman::Server::Client $worker = $job->worker)
510 0 0 if (length $job->{'uniq'})
538 1 1 if (defined $max and length $max and $max > 0) { }
561 0 0 unless $self->{'job_of_uniq'}{$func}
581 0 0 unless $self->{'job_queue'}{$func}
591 0 0 unless $job
592 0 0 unless $job->require_listener
595 0 0 if $c and not $c->{'closed'}