[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:59 UTC 2013


The following commit has been merged in the master branch:
commit 10f41ca57b88852d39ee4dbfacbc6c1a45650967
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sat May 26 15:46:04 2012 +0100

    Better docs, fix spelling tests.

diff --git a/lib/Message/Passing/Filter/Delay.pm b/lib/Message/Passing/Filter/Delay.pm
index 26f77d3..6f3182f 100644
--- a/lib/Message/Passing/Filter/Delay.pm
+++ b/lib/Message/Passing/Filter/Delay.pm
@@ -32,20 +32,28 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 NAME
 
-Message::Passing::Filter::Null - Filter no messages out.
+Message::Passing::Filter::Delay - Delay messages for some time.
 
 =head1 DESCRIPTION
 
-This filter does nothing, passing all incoming messages through with no changes.
+This filter passes all incoming messages through with no changes, however
+not immediately - they are delayed .
 
 You would normally never want to use this, but it can be useful for
-testing occasionally.
+testing occasionally, or avoiding race conditions.
+
+=head1 ATTRIBUTES
+
+=head2 delay_for
+
+Floating point number, indicating how many seconds to delay messages for.
 
 =head1 METHODS
 
-=head2 filter
+=head2 consume ($msg)
 
-Returns the message passed to it.
+Sets up a timed callback in the event loop, which passes the message
+to the output (and deletes itself) once the timeout has expired
 
 =head1 SPONSORSHIP
 
diff --git a/lib/Message/Passing/Manual.pod b/lib/Message/Passing/Manual.pod
index 43242cc..821db32 100644
--- a/lib/Message/Passing/Manual.pod
+++ b/lib/Message/Passing/Manual.pod
@@ -12,7 +12,7 @@ How (and why) logstash works.
 
 =item L<Message::Passing::Manual::Cookbook>
 
-Practical examplesof things you can do with the framework.
+Practical examples of things you can do with the framework.
 
 =item L<Message::Passing::Manual::Components>
 
diff --git a/lib/Message/Passing/Manual/Cookbook.pod b/lib/Message/Passing/Manual/Cookbook.pod
index 9526877..28995b0 100644
--- a/lib/Message/Passing/Manual/Cookbook.pod
+++ b/lib/Message/Passing/Manual/Cookbook.pod
@@ -26,14 +26,14 @@ You can use L<Log::Dispatch>, or any log system which will output into L<Log::Di
     ));
 
     $log->warn($_) for qw/ foo bar baz /;
-    
+
 =head2 Aggregating this log
 
 As simple as using the command line interface:
 
     logstash --input ZeroMQ --input_options '{"socket_bind":"tcp://192.168.0.1:5558"}' \
         --output File --output_options '{"filename":"/tmp/mylog"}'
-        
+
 And you've now got a multi-host log aggregation system for your application!
 
 =head1 Aggregating syslog
@@ -49,7 +49,7 @@ messages to it. The listener will then forward from each host to a central aggre
 =head2 On host collector
 
     logstash --input Syslog --output ZeroMQ --output_options '{"connect":"tcp://192.168.0.1:5558"}' 
-    
+
 =head2 Configuring your syslogd
 
 This should be easy, here's an example of what to add to rsyslogd.conf to get the syslog resent.
@@ -61,7 +61,7 @@ This should be easy, here's an example of what to add to rsyslogd.conf to get th
 
 If you have hosts with both applications and syslog that you want to aggregate, then you can easily
 do both at once. This also means that your apps ship logs to a local buffer process rather than
-directly across the network - which is more resiliant to short network outages.
+directly across the network - which is more resilient to short network outages.
 
 This
 
diff --git a/lib/Message/Passing/Output/Callback.pm b/lib/Message/Passing/Output/Callback.pm
index c63aaea..a45bcd9 100644
--- a/lib/Message/Passing/Output/Callback.pm
+++ b/lib/Message/Passing/Output/Callback.pm
@@ -29,6 +29,12 @@ Message::Passing::Output::Callback - Output to call back into your code
         },
     );
 
+=head1 METHODS
+
+=head2 consume ($msg)
+
+Calls the callback with the message as it's first parameter
+
 =head1 SEE ALSO
 
 L<Message::Passing>
diff --git a/lib/Message/Passing/Role/ConnectionManager.pm b/lib/Message/Passing/Role/ConnectionManager.pm
index ffbbdb5..38c1f79 100644
--- a/lib/Message/Passing/Role/ConnectionManager.pm
+++ b/lib/Message/Passing/Role/ConnectionManager.pm
@@ -77,7 +77,8 @@ a notifies
 
 =head2 _build_connection
 
-Build and return the underlieing connection, start the connection process and return it.
+Build and return the connection we're managing, start the connection
+process.
 
 Your connection should use the API as documented below to achieve notification of connect and disconnect events.
 
@@ -118,4 +119,10 @@ A Boolean indicating if the connection is currently considered fully connected
 The underlieing connection object (if we are connected, or connecting currently) - can
 be undefined if we are during a reconnect timeout.
 
+=head1 METHODS
+
+=head2 subscribe_to_connect
+
+
+
 =cut
diff --git a/lib/Message/Passing/Role/HasAConnection.pm b/lib/Message/Passing/Role/HasAConnection.pm
index 879d339..fe64418 100644
--- a/lib/Message/Passing/Role/HasAConnection.pm
+++ b/lib/Message/Passing/Role/HasAConnection.pm
@@ -49,7 +49,7 @@ Usually used to do things like subscribe to queues..
 
 =head2 disconnected ($client)
 
-The client recieved an error or otherwise disconnected.
+The client received an error or otherwise disconnected.
 
 =head1 ATTRIBUTES
 
@@ -62,3 +62,4 @@ The client recieved an error or otherwise disconnected.
 Is wrapped to build the connection manager object.
 
 =cut
+
diff --git a/lib/Message/Passing/Role/Script.pm b/lib/Message/Passing/Role/Script.pm
index 0baa9ac..8cee6cc 100644
--- a/lib/Message/Passing/Role/Script.pm
+++ b/lib/Message/Passing/Role/Script.pm
@@ -91,7 +91,93 @@ sub start {
 
 =head1 NAME
 
-Message::Passing:Role::Script - Handy role for scripts.
+Message::Passing:Role::Script - Handy role for building messaging scripts.
+
+=head1 SYNOPSIS
+
+    # my_message_passer.pl
+    package My::Message::Passer;
+    use Moose;
+    use Message::Passing::DSL;
+
+    with 'Message::Passing::Role::Script';
+    with 'MooseX::Getopt';
+
+    has foo => (
+        is => 'ro',
+        isa => 'Bool',
+    );
+
+    sub build_chain {
+        my $self = shift;
+        log_chain {
+            input example => ( output_to => 'test_out', .... );
+            output test_out => ( foo => $self->foo, ... );
+        };
+    }
+
+    __PACKAGE__->start unless caller;
+    1;
+
+=head1 DESCRIPTION
+
+This role can be used to make simple message passing scripts.
+
+The user implements a L<MooseX::Getopt> type script class, with a
+C<build_chain> method, that builds one or more
+L<Message::Passing> chains and returns them.
+
+    __PACKAGE__->start unless caller;
+
+is then used before the end of the script.
+
+This means that when the code is run as a script, it'll parse
+the command line options, and start a message passing server..
+
+=head1 REQUIRED METHODS
+
+=head1 build_chain
+
+Return a chain of message processors, or an array reference with
+multiple chains of message processors.
+
+=head1 METHODS
+
+=head2 start
+
+Called as a class method, it will build the current class as a
+command line script (parsing ARGV), setup the daemonization options,
+call the ->build_chain method supplied by the user to build the
+chains needed for this application.
+
+Then enters the event loop and never returns.
+
+=head2 change_uid_if_needed
+
+Tries to change uid if the --user option has been supplied
+
+=head2 deamonize_if_needed
+
+Tires to daemonize if the --daemonize option has been supplied
+
+=head2 set_io_priority_if_needed
+
+Tries to set the process' IO priority if the --io_priority option
+has been supplied.
+
+Valid values for the IO priority are:
+
+=over
+
+=item none
+
+=item be
+
+=item rt
+
+=item idle
+
+=back
 
 =head1 AUTHOR
 
diff --git a/t/author/spelling.t b/t/author/spelling.t
index d273def..80781d5 100644
--- a/t/author/spelling.t
+++ b/t/author/spelling.t
@@ -4,6 +4,11 @@ use Test::More;
 use Test::Spelling;
 
 add_stopwords(qw(
+    multi
+    rsyslogd
+    syslogd
+    AnyEvent
+    DSL
     SureVoIP
     VoIP
     Starman

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list