line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Beekeeper::JSONRPC::Request; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
83
|
use strict; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
323
|
|
4
|
11
|
|
|
11
|
|
67
|
use warnings; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
4301
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
11
|
0
|
|
|
|
|
0
|
bless { |
12
|
|
|
|
|
|
|
jsonrpc => '2.0', |
13
|
|
|
|
|
|
|
method => undef, |
14
|
|
|
|
|
|
|
params => undef, |
15
|
|
|
|
|
|
|
id => undef, |
16
|
|
|
|
|
|
|
@_ |
17
|
|
|
|
|
|
|
}, $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
0
|
sub method { $_[0]->{method} } |
21
|
0
|
|
|
0
|
1
|
0
|
sub params { $_[0]->{params} } |
22
|
0
|
|
|
0
|
1
|
0
|
sub id { $_[0]->{id} } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub response { |
25
|
2
|
|
|
2
|
1
|
790
|
$_[0]->{_response}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub result { |
29
|
|
|
|
|
|
|
# Shortcut for $req->response->result |
30
|
12
|
100
|
|
12
|
1
|
5628
|
return ($_[0]->{_response}) ? $_[0]->{_response}->{result} : undef; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub success { |
34
|
|
|
|
|
|
|
# Shortcut for $req->response->success |
35
|
2
|
100
|
|
2
|
1
|
21
|
return ($_[0]->{_response}) ? $_[0]->{_response}->success : undef; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mqtt_properties { |
39
|
0
|
|
|
0
|
1
|
|
$_[0]->{_mqtt_properties}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub async_response { |
43
|
0
|
|
|
0
|
1
|
|
$_[0]->{_async_response} = 1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub deflate_response { |
47
|
0
|
|
0
|
0
|
1
|
|
$_[0]->{_deflate_response} = $_[2] || 1024; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub send_response { |
51
|
0
|
|
|
0
|
1
|
|
$_[0]->{_worker}->__send_response(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |