3 package MooseX::Daemonize::Pid;
6 use Moose::Util::TypeConstraints;
7 use namespace::autoclean;
9 coerce 'MooseX::Daemonize::Pid'
11 => via { MooseX::Daemonize::Pid->new( pid => $_ ) };
18 clearer => 'clear_pid',
19 predicate => 'has_pid',
23 sub is_running { kill(0, (shift)->pid) ? 1 : 0 }
33 MooseX::Daemonize::Pid - PID management for MooseX::Daemonize
37 This is a very basic Pid management object, it doesn't do all that
38 much, and mostly just serves as a base class for L<MooseX::Daemonize::Pid::File>.
54 This will clear the value of the I<pid> attribute. It is useful for making sure
55 that the parent process does not have a bad value stored in it.
59 This is a predicate method to tell you if your I<pid> attribute has
64 This checks to see if the I<pid> is running.
68 The C<meta()> method from L<Class::MOP::Class>
76 =head1 INCOMPATIBILITIES
80 =head1 BUGS AND LIMITATIONS
82 No bugs have been reported.
84 Please report any bugs or feature requests to
85 C<bug-acme-dahut-call@rt.cpan.org>, or through the web interface at
86 L<http://rt.cpan.org>.
90 Stevan Little C<< <stevan.little@iinteractive.com> >>
92 =head1 LICENCE AND COPYRIGHT
94 Copyright (c) 2007-2011, Chris Prather C<< <perigrin@cpan.org> >>. All rights
97 This module is free software; you can redistribute it and/or
98 modify it under the same terms as Perl itself. See L<perlartistic>.
100 =head1 DISCLAIMER OF WARRANTY
102 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
103 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
104 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
105 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
106 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
107 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
108 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
109 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
110 NECESSARY SERVICING, REPAIR, OR CORRECTION.
112 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
113 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
114 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
115 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
116 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
117 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
118 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
119 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
120 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF