line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Rendezvous::Publish; |
2
|
1
|
|
|
1
|
|
905
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
556
|
use Net::Rendezvous::Publish::Service; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Module::Pluggable |
7
|
1
|
|
|
|
|
8
|
search_path => [ "Net::Rendezvous::Publish::Backend" ], |
8
|
1
|
|
|
1
|
|
896
|
sub_name => 'backends'; |
|
1
|
|
|
|
|
54530
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
106
|
use base qw( Class::Accessor::Lvalue ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
374
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( _backend _published )); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.04; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
17
|
0
|
|
|
|
|
|
my %args = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
0
|
|
|
|
my ($backend) = $args{backend} || (grep !/::Null$/, $self->backends)[0]; |
22
|
0
|
|
0
|
|
|
|
$backend ||= "Net::Rendezvous::Publish::Backend::Null"; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
eval "require $backend" or die $@; |
25
|
0
|
0
|
|
|
|
|
return unless $backend; |
26
|
0
|
0
|
|
|
|
|
$self->_backend = $backend->new |
27
|
|
|
|
|
|
|
or return; |
28
|
0
|
|
|
|
|
|
$self->_published = []; |
29
|
0
|
|
|
|
|
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub publish { |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my $service = Net::Rendezvous::Publish::Service->new; |
35
|
0
|
|
|
|
|
|
$service->_session = $self; |
36
|
0
|
0
|
|
|
|
|
$service->_handle = $self->_backend->publish( object => $service, @_ ) |
37
|
|
|
|
|
|
|
or return; |
38
|
0
|
|
|
|
|
|
return $service; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub step { |
42
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
43
|
0
|
|
|
|
|
|
$self->_backend->step( shift ); |
44
|
0
|
|
|
|
|
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |