[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88
Tomas Doran
bobtfish at bobtfish.net
Mon May 6 11:56:57 UTC 2013
The following commit has been merged in the master branch:
commit 50c5c83a2a1b4c2af991ca55fe2292d85a0690a0
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Mon May 21 10:41:41 2012 +0100
Compile tests for new roles, more docs
diff --git a/lib/Log/Stash/Role/ConnectionManager.pm b/lib/Log/Stash/Role/ConnectionManager.pm
index 2702cb4..8c13fd6 100644
--- a/lib/Log/Stash/Role/ConnectionManager.pm
+++ b/lib/Log/Stash/Role/ConnectionManager.pm
@@ -24,7 +24,7 @@ has connection => (
clearer => '_clear_connection'
);
-has connect_subscribers => (
+has _connect_subscribers => (
isa => 'ArrayRef',
is => 'ro',
default => sub { [] },
@@ -33,7 +33,7 @@ has connect_subscribers => (
sub __clean_subs {
my $self = shift;
- my $subs = [ grep { defined $_ } @{$self->connect_subscribers} ];
+ my $subs = [ grep { defined $_ } @{$self->_connect_subscribers} ];
$self->_set_connect_subscribers($subs);
}
@@ -42,7 +42,7 @@ sub subscribe_to_connect {
confess "Subscriber '$subscriber' is not blessed" unless blessed $subscriber;
confess "Subscriber '$subscriber' does not have a ->connected method" unless $subscriber->can('connected');
$self->__clean_subs;
- my $subs = $self->connect_subscribers;
+ my $subs = $self->_connect_subscribers;
push(@$subs, $subscriber);
weaken(@{$subs}[-1]);
if ($self->connected) {
@@ -55,7 +55,7 @@ after _set_connected => sub {
my ($self, $connected) = @_;
$self->__clean_subs;
my $method = $connected ? 'connected' : 'disconnected';
- foreach my $sub (@{$self->connect_subscribers}) {
+ foreach my $sub (@{$self->_connect_subscribers}) {
$sub->$method($self->connection) if $sub->can($method);
}
$self->_clear_connection unless $connected;
@@ -109,4 +109,15 @@ once the connection is established.
See L<Log::Stash::Role::HasAConnection> for a role to help with dealing with a connection manager.
+=head1 ATTRIBUTES
+
+=head2 connected
+
+A Boolean indicating if the connection is currently considered fully connected
+
+=head2 connection
+
+The underlieing connection object (if we are connected, or connecting currently) - can
+be undefined if we are during a reconnect timeout.
+
=cut
diff --git a/t/00_compile.t b/t/00_compile.t
index a50adae..a6cf762 100644
--- a/t/00_compile.t
+++ b/t/00_compile.t
@@ -3,6 +3,8 @@ use warnings;
use Test::More;
+use_ok('Log::Stash::Role::HasAConnection');
+use_ok('Log::Stash::Role::ConnectionManager');
use_ok('Log::Stash');
use_ok('Log::Stash::Output::STDOUT');
use_ok('Log::Stash::Input::STDIN');
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list