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