Name

Class::Usul::Lock - Command line access to the IPC::SRLock methods

Synopsis

use Class::Usul::Lock;

my $app = Class::Usul::Lock->new_with_options( appclass => 'YourApp' );

$app->quiet( 1 );

exit $app->run;

Description

Command line access to the IPC::SRLock methods

Configuration and Environment

Defines the following attributes;

lock_key

String which is the key used to set/reset a lock. Set from the command line with the k switch

lock_pid

Integer which is the process id associated with a lock. Defaults to $PID. Set from the command line with the p switch

lock_timeout

Integer which is the timeout in seconds before a lock is declared stale. Defaults to five minutes. Set from the command line with the t switch

Subroutines/Methods

list - Lists the locks in the lock table

Output is comma separated

reset - Resets the specified lock

Resets the lock keyed by the lock_key attribute

set - Sets the specified lock

Set the lock keyed by the lock_key attribute. Optionally use the lock_pid and lock_timeout attributes

Diagnostics

None

Dependencies

Class::Usul::Programs
Class::Usul::Time
Moo

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2018 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE