NAME
XAS::Lib::Lockmgr::Nolock - Use no locking at all.
SYNOPSIS
use XAS::Lib::Lockmgr;
my $key = '/var/lock/xas/alerts';
my $lockmgr = XAS::Lib::Lockmgr->new();
$lockmgr->add(
-key => $key,
-driver => 'Nolock',
);
if ($lockmgr->try_lock($key)) {
$lockmgr->lock($key);
...
$lockmgr->unlock($key);
}
DESCRIPTION
This class uses nothing to manage locks. This is a placeholder and allows for fake discretionary locking of resources.
CONFIGURATION
This module uses the following fields in -args.
METHODS
lock
Attempt to aquire a lock. Returns TRUE for success, FALSE otherwise.
unlock
Remove the lock. Returns TRUE for success, FALSE otherwise.
try_lock
Check to see if a lock could be aquired. Returns FALSE if not, TRUE otherwise.
exceptions
Returns the exceptions that you may not want to continue lock attemtps if triggered.
SEE ALSO
AUTHOR
Kevin L. Esteb, <kevin@kesteb.us>
COPYRIGHT AND LICENSE
Copyright (c) 2012-2016 Kevin L. Esteb
This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.