[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:12 UTC 2013
The following commit has been merged in the master branch:
commit ea82ea16d8b45c0cddf8dcae914143c528d7b56b
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Sun Jun 10 17:30:30 2012 +0100
Document the attributes in Message::Passing::Role::Script
Other misc cleanups included
diff --git a/Changes b/Changes
index 5ff06bd..2da4d6c 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+ - Document the attributes in Message::Passing::Role::Script
+
- Add STDERR output.
- Rename the log_chain function to message_chain and run_log_server
diff --git a/TODO b/TODO
index 7299174..ac4062f 100644
--- a/TODO
+++ b/TODO
@@ -16,6 +16,15 @@ Specific adaptors
Docs:
+ Message::Passing::Role::CLIComponent:
+ - Write docs!
+
+ Role::ConnectionManager
+ - Fix docs
+
+ Role::HasAconnection
+ - Fix docs
+
Message::Passing::Manual::Scripts:
- Write me!
- encoders / decoders
diff --git a/lib/Message/Passing/Role/Input.pm b/lib/Message/Passing/Role/Input.pm
index 418118c..0f61b57 100644
--- a/lib/Message/Passing/Role/Input.pm
+++ b/lib/Message/Passing/Role/Input.pm
@@ -29,12 +29,6 @@ Produces messages.
Required, must perform the L<Message::Passing::Role::Output> role.
-=head1 METHODS
-
-=head2 decode
-
-JSON decodes a message supplied as a parameter.
-
=head1 SEE ALSO
=over
diff --git a/lib/Message/Passing/Role/Output.pm b/lib/Message/Passing/Role/Output.pm
index 0305ccd..c1cf6d0 100644
--- a/lib/Message/Passing/Role/Output.pm
+++ b/lib/Message/Passing/Role/Output.pm
@@ -4,12 +4,6 @@ use JSON qw/ to_json /;
use Scalar::Util qw/ blessed /;
use namespace::autoclean;
-has pretty => (
- isa => 'Bool',
- default => 0,
- is => 'ro',
-);
-
requires 'consume';
1;
diff --git a/lib/Message/Passing/Role/Script.pm b/lib/Message/Passing/Role/Script.pm
index a9e95df..87acf8d 100644
--- a/lib/Message/Passing/Role/Script.pm
+++ b/lib/Message/Passing/Role/Script.pm
@@ -14,6 +14,20 @@ has daemonize => (
default => 0,
);
+has io_priority => (
+ isa => enum([qw[ none be rt idle ]]),
+ is => 'ro',
+ predicate => "_has_io_priority",
+);
+
+foreach my $name (qw/ user pid_file /) {
+ has $name => (
+ isa => 'Str',
+ is => 'ro',
+ predicate => "_has_$name",
+ );
+}
+
sub deamonize_if_needed {
my ($self) = @_;
my $fh;
@@ -51,20 +65,6 @@ sub change_uid_if_needed {
}
}
-foreach my $name (qw/ user pid_file /) {
- has $name => (
- isa => 'Str',
- is => 'ro',
- predicate => "_has_$name",
- );
-}
-
-has io_priority => (
- isa => enum([qw[ none be rt idle ]]),
- is => 'ro',
- predicate => "_has_io_priority",
-);
-
sub set_io_priority_if_needed {
my $self = shift;
return unless $self->_has_io_priority;
@@ -100,8 +100,10 @@ Message::Passing:Role::Script - Handy role for building messaging scripts.
use Moose;
use Message::Passing::DSL;
- with 'Message::Passing::Role::Script';
- with 'MooseX::Getopt';
+ with qw/
+ Message::Passing::Role::Script
+ MooseX::Getopt
+ /;
has foo => (
is => 'ro',
@@ -141,6 +143,40 @@ the command line options, and start a message passing server..
Return a chain of message processors, or an array reference with
multiple chains of message processors.
+=head1 ATTRIBUTES
+
+=head2 daemonize
+
+Do a double fork and lose controlling terminal.
+
+Used to run scripts in the background.
+
+=head2 io_priority
+
+The IO priority to run the script at..
+
+Valid values for the IO priority are:
+
+=over
+
+=item none
+
+=item be
+
+=item rt
+
+=item idle
+
+=back
+
+=head2 user
+
+Changes the user the script is running as. You probably need to run the script as root for this option to work.
+
+=head2 pid_file
+
+Write a pid file out. Useful for running Message::Passing scripts as daemons and/or from init scripts.
+
=head1 METHODS
=head2 start
@@ -165,20 +201,6 @@ Tires to daemonize if the --daemonize option has been supplied
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
Tomas (t0m) Doran <bobtfish at bobtfish.net>
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list