might not be totally insane
use Carp ();
use DBI;
use Data::GUID ();
use DBIx::Locker::Lock;
use JSON 2 ();
use Sys::Hostname ();
#pod =head1 DESCRIPTION
#pod
#pod ...and a B<warning>.
#pod
#pod DBI
#pod
#pod This method attempts to return a new DBIx::Locker::Lock.
#pod
#pod =cut
my $JSON;
BEGIN { $JSON = JSON->new->canonical(1)->space_after(1); }
sub lock {
my ($self, $lockstring, $arg) = @_
lockstring,
$self->_time_to_string,
$self->_time_to_string([ localtime($expires) ]),
$JSON->encode($locked_by),
);
die(
"could not lock resource <$lockstring>" . (
$dbh->err