PLS/Server/Request/CancelRequest.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 45.9% 17 / 37 CC 4 SCAR 23.5
CC
4
Cov
45%
service
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 10.5
« PLS/Server/Method/ServerMethod.pm ↑ Summary PLS/Server/Response/Location.pm »
1 package PLS::Server::Request::CancelRequest;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent 'PLS::Server::Request';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use PLS::Server::Response::Cancelled;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 PLS::Server::Request::CancelRequest
13  
14 =head1 DESCRIPTION
15  
16 This is a notification message from the client to the server requesting
17 that a request be cancelled.
18  
19 =cut
20  
21 sub service
22 {
23 0 ▶ my ($self, $server) = @_;
Subroutine service: not called CC=4 SCAR=30.0
Pod undocumented
24  
25 0 my $id = $self->{params}{id};
26 0 ▶ return unless (exists $server->{running_coros}{$id});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $server->{"running_coros"}{$id} 0 0 0
27 0 my $request_to_cancel = $server->{running_coros}{$id};
28  
29 0 ▶ return unless (blessed($request_to_cancel) and $request_to_cancel->isa('Coro'));
Branch: 1 branch
BranchTrueFalseTotal
unless blessed($request_to_cancel) and $request_to_cancel->isa("Coro") 0 0 0
Condition0%0/3
blessed($request_to_cancel) and $request_to_cancel->isa("Coro")
!ll&&!rl&&r
000
MC/DC0%0/2
blessed($request_to_cancel) and $request_to_cancel->isa("Coro")
blessed($request_to_cancel) $request_to_cancel->isa("Coro")
Truth table0%0/3
A and B
A= blessed($request_to_cancel)B= $request_to_cancel->isa("Coro")
ABresult
0X0
100
111
30 0 eval { $request_to_cancel->safe_cancel() };
31  
32 0 delete $server->{running_coros}{$id};
33  
34 0 return PLS::Server::Response::Cancelled->new(id => $id);
35 } ## end sub service
36  
37 1 1;
« PLS/Server/Method/ServerMethod.pm ↑ Summary PLS/Server/Response/Location.pm »