[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:57:10 UTC 2013
The following commit has been merged in the master branch:
commit 2f2bb622fea9146007911d78523158755958a193
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Sun Jun 10 11:37:30 2012 +0100
Rename log_chain to message_chain
diff --git a/Changes b/Changes
index 2254cb2..a43bb0f 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+ - Rename the log_chain function in Message::Passing::DSL
+ to message_chain to follow general rename, as we're not just
+ about logs.
+
0.007
- Documentation in the message-pass script
diff --git a/lib/Message/Passing.pm b/lib/Message/Passing.pm
index a03f5d3..c30dcc8 100644
--- a/lib/Message/Passing.pm
+++ b/lib/Message/Passing.pm
@@ -31,7 +31,7 @@ sub get_config_from_file {
sub build_chain {
my $self = shift;
- log_chain {
+ message_chain {
output output => (
$self->output_options,
class => $self->output,
diff --git a/lib/Message/Passing/DSL.pm b/lib/Message/Passing/DSL.pm
index edf62b9..f721733 100644
--- a/lib/Message/Passing/DSL.pm
+++ b/lib/Message/Passing/DSL.pm
@@ -9,15 +9,15 @@ use AnyEvent;
use Moose::Util qw/ does_role /;
Moose::Exporter->setup_import_methods(
- as_is => [qw/ run_log_server log_chain input filter output decoder encoder /],
+ as_is => [qw/ run_log_server message_chain input filter output decoder encoder /],
);
our $FACTORY;
sub _check_factory {
- confess("Not inside a chain { block!!") unless $FACTORY;
+ confess("Not inside a message_chain { block!!") unless $FACTORY;
}
-sub log_chain (&) {
+sub message_chain (&) {
my $code = shift;
if ($FACTORY) {
confess("Cannot chain within a chain");
@@ -117,7 +117,7 @@ Message::Passing::DSL - An easy way to make chains of Message::Passing component
sub build_chain {
my $self = shift;
- log_chain {
+ message_chain {
output console => (
class => 'STDOUT',
);
@@ -140,7 +140,7 @@ the built in message-pass script.
=head2 FUNCTIONS
-=head3 log_chain
+=head3 message_chain
Constructs a log chain (i.e. a series of log objects feeding into each
other), warns about any unused parts of the chain, and returns the
@@ -155,7 +155,7 @@ See example in the SYNOPSIS, and details on the other functions below.
Constructs a named output within a chain.
- log_chain {
+ message_chain {
output foo => ( class => 'STDOUT' );
....
};
@@ -167,7 +167,7 @@ unless you prefix the class with + e.g. C<< +My::Own::Output::Class >>
Constructs a named encoder within a chain.
- log_chain {
+ message_chain {
encoder fooenc => ( output_to => 'out', class => 'JSON' );
....
};
@@ -180,7 +180,7 @@ unless you prefix the class with + e.g. C<< +My::Own::Encoder::Class >>
Constructs a named filter (which can act as both an output and an input)
within a chain.
- log_chain {
+ message_chain {
...
filter bar => ( output_to => 'fooenc', class => 'Null' );
...
@@ -193,7 +193,7 @@ unless you prefix the class with + e.g. C<< +My::Own::Filter::Class >>
Constructs a named decoder within a chain.
- log_chain {
+ message_chain {
decoder zmq_decode => ( output_to => 'filter', class => 'JSON' );
....
};
@@ -206,7 +206,7 @@ unless you prefix the class with + e.g. C<< +My::Own::Encoder::Class >>
The last thing in a chain - produces data which gets consumed.
- log_chain {
+ message_chain {
...
input zmq => ( output_to => 'zmq_decode', class => 'ZeroMQ', bind => '...' );
....
@@ -220,8 +220,8 @@ unless you prefix the class with + e.g. C<< +My::Own::Output::Class >>
This enters the event loop and causes log events to be consumed and
processed.
-Can be passed a log_chain to run, although this is entirely optional
-(as all log chains which are still in scope will run when the event
+Can be passed a message_chain to run, although this is entirely optional
+(as all chains which are still in scope will run when the event
loop is entered).
=head1 SPONSORSHIP
diff --git a/lib/Message/Passing/Manual/Concepts.pod b/lib/Message/Passing/Manual/Concepts.pod
index 37c86f8..6a2a46a 100644
--- a/lib/Message/Passing/Manual/Concepts.pod
+++ b/lib/Message/Passing/Manual/Concepts.pod
@@ -89,7 +89,7 @@ The example above becomes:
use Message::Passing::DSL;
- run_log_server log_chain {
+ run_log_server message_chain {
input file => (
class => 'FileTail',
output_to => 'stdout',
diff --git a/lib/Message/Passing/Manual/Cookbook.pod b/lib/Message/Passing/Manual/Cookbook.pod
index 254985b..d9b50dc 100644
--- a/lib/Message/Passing/Manual/Cookbook.pod
+++ b/lib/Message/Passing/Manual/Cookbook.pod
@@ -10,19 +10,19 @@ You can use L<Log::Dispatch>, or any log system which will output into L<Log::Di
use Log::Dispatch;
use Log::Dispatch::Message::Passing;
- use Message::Passing::DSL;
+ use Message::Passing::Filter::Encoder::JSON;
+ use Message::Passing::Output::ZeroMQ;
my $log = Log::Dispatch->new;
$log->add(Log::Dispatch::Message::Passing->new(
name => 'myapp_aggregate_log',
min_level => 'debug',
- output => log_chain {
- output zmq => (
- class => 'ZeroMQ',
+ output => Message::Passing::Filter::Encoder::JSON->new(
+ output_to => Message::Passing::Output::ZeroMQ->new(
connect => 'tcp://192.168.0.1:5558',
- );
- },
+ ),
+ ),
));
$log->warn($_) for qw/ foo bar baz /;
diff --git a/lib/Message/Passing/Role/Script.pm b/lib/Message/Passing/Role/Script.pm
index feec67c..490a3bb 100644
--- a/lib/Message/Passing/Role/Script.pm
+++ b/lib/Message/Passing/Role/Script.pm
@@ -110,7 +110,7 @@ Message::Passing:Role::Script - Handy role for building messaging scripts.
sub build_chain {
my $self = shift;
- log_chain {
+ message_chain {
input example => ( output_to => 'test_out', .... );
output test_out => ( foo => $self->foo, ... );
};
diff --git a/t/dsl.t b/t/dsl.t
index 46e4ed5..025cd42 100644
--- a/t/dsl.t
+++ b/t/dsl.t
@@ -4,7 +4,7 @@ use Test::More;
use Message::Passing::DSL;
-my $c = log_chain {
+my $c = message_chain {
output test => (
class => 'Test',
);
@@ -30,7 +30,7 @@ my $test = $c->[0]->output_to->output_to->output_to->[0];
is $test->message_count, 1;
is_deeply [$test->messages], [{foo => 'bar'}];
-$c = log_chain {
+$c = message_chain {
output logcollector_central => (
class => 'STDOUT',
);
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list