line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#+############################################################################## |
2
|
|
|
|
|
|
|
# # |
3
|
|
|
|
|
|
|
# File: Messaging/Message/Queue.pm # |
4
|
|
|
|
|
|
|
# # |
5
|
|
|
|
|
|
|
# Description: abstraction of a message queue # |
6
|
|
|
|
|
|
|
# # |
7
|
|
|
|
|
|
|
#-############################################################################## |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# module definition |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Messaging::Message::Queue; |
14
|
2
|
|
|
2
|
|
755
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
45
|
|
15
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
113
|
|
16
|
|
|
|
|
|
|
our $VERSION = "1.6"; |
17
|
|
|
|
|
|
|
our $REVISION = sprintf("%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# used modules |
21
|
|
|
|
|
|
|
# |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
7
|
use Messaging::Message qw(_require); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
7
|
|
24
|
2
|
|
|
2
|
|
113
|
use Params::Validate qw(validate_with :types); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
407
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
# constructor |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new : method { |
31
|
2
|
|
|
2
|
1
|
2155
|
my($class, %option, $mqc); |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
2
|
$class = shift(@_); |
34
|
2
|
|
|
|
|
40
|
%option = validate_with( |
35
|
|
|
|
|
|
|
params => \@_, |
36
|
|
|
|
|
|
|
spec => { |
37
|
|
|
|
|
|
|
type => { type => SCALAR, regex => qr/^[a-zA-Z0-9]+$/ }, |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
allow_extra => 1, |
40
|
|
|
|
|
|
|
); |
41
|
2
|
|
|
|
|
29
|
$mqc = $class . "::" . $option{type}; |
42
|
2
|
|
|
|
|
6
|
_require($mqc); |
43
|
1
|
|
|
|
|
2
|
delete($option{type}); |
44
|
1
|
|
|
|
|
5
|
return($mqc->new(\%option)); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__DATA__ |