line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Argon::Constants; |
2
|
|
|
|
|
|
|
# ABSTRACT: Constants used by Argon classes |
3
|
|
|
|
|
|
|
$Argon::Constants::VERSION = '0.18'; |
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
520650
|
use strict; |
|
9
|
|
|
|
|
39
|
|
|
9
|
|
|
|
|
324
|
|
6
|
9
|
|
|
9
|
|
63
|
use warnings; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
348
|
|
7
|
9
|
|
|
9
|
|
3333
|
use Const::Fast; |
|
9
|
|
|
|
|
14842
|
|
|
9
|
|
|
|
|
85
|
|
8
|
9
|
|
|
9
|
|
1428
|
use parent 'Exporter'; |
|
9
|
|
|
|
|
655
|
|
|
9
|
|
|
|
|
84
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
12
|
|
|
|
|
|
|
# Defaults |
13
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
const our $EOL => "\015\012"; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
18
|
|
|
|
|
|
|
# Priorities |
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
20
|
|
|
|
|
|
|
const our $HIGH => 0; |
21
|
|
|
|
|
|
|
const our $NORMAL => 1; |
22
|
|
|
|
|
|
|
const our $LOW => 2; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
26
|
|
|
|
|
|
|
# Commands |
27
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
28
|
|
|
|
|
|
|
const our $ID => 'ID'; |
29
|
|
|
|
|
|
|
const our $PING => 'PING'; |
30
|
|
|
|
|
|
|
const our $ACK => 'ACK'; |
31
|
|
|
|
|
|
|
const our $ERROR => 'ERROR'; |
32
|
|
|
|
|
|
|
const our $QUEUE => 'QUEUE'; |
33
|
|
|
|
|
|
|
const our $DENY => 'DENY'; |
34
|
|
|
|
|
|
|
const our $DONE => 'DONE'; |
35
|
|
|
|
|
|
|
const our $HIRE => 'HIRE'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
38
|
|
|
|
|
|
|
# Exports |
39
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
40
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
41
|
|
|
|
|
|
|
defaults => [qw($EOL)], |
42
|
|
|
|
|
|
|
priorities => [qw($HIGH $NORMAL $LOW)], |
43
|
|
|
|
|
|
|
commands => [qw($ID $PING $ACK $ERROR $QUEUE $DENY $DONE $HIRE)], |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=pod |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding UTF-8 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Argon::Constants - Constants used by Argon classes |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 VERSION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
version 0.18 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Constants used by Argon. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 EXPORT TAGS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 :defaults |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head3 $EOL |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
End of line character (C<"\015\012">). |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 :priorities |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Priority levels for L<Argon::Message>s. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head3 $HIGH |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head3 $NORMAL |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head3 $LOW |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 :commands |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Command verbs used in the Argon protocol. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head3 $ID |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Used by L<Argon::SecureChannel> to identify itself to the other side of the |
93
|
|
|
|
|
|
|
line. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head3 $PING |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Used internally to identify when a worker or the manager becomes unavailable. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head3 $ACK |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Response when affirming a prior command. Used in response to C<$HIRE> and |
102
|
|
|
|
|
|
|
C<$PING>. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head3 $ERROR |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Response when the prior command failed due to an error. Generally used only |
107
|
|
|
|
|
|
|
with C<$QUEUE>. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head3 $QUEUE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Queues a message with the manager. If the service is at capacity, elicits a |
112
|
|
|
|
|
|
|
response of C<$DENY>. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head3 $DENY |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Response sent after an attempt to C<$QUEUE> when the system is at max capacity. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head3 $DONE |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Response sent after C<$QUEUE> when the task has been completed without error. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head3 $HIRE |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Used internally by the L<Argon::Worker> to announce its capacity when |
125
|
|
|
|
|
|
|
registering with the L<Argon::Manager>. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHOR |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Jeff Ober <sysread@fastmail.fm> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Jeff Ober. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
136
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |