The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Base::Script::OnlyOne - do not allow more than one instance running

SYNOPSIS

    use Moose;
    extends 'App::Base::Script';
    with 'App::Base::Script::OnlyOne';

DESCRIPTION

With this role your script will refuse to start if another copy of the script is running already (or if it is deadlocked or entered an infinite loop because of programming error). After start it tries to lock pid file, and if this is not possible, it dies.