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