IPC-ConcurrencyLimit-Lock-MySQL
view release on metacpan or search on metacpan
xt/stress.t view on Meta::CPAN
$| = 1;
our($db, $usr, $pwd, $host, $port);
my $conf_file = 'mysql.dat';
if (-e $conf_file) {
# eval connection parameters into existance
my $ok = do $conf_file;
defined $ok or die "Error loading $conf_file: ", $@||$!;
unless (defined $db) {
die "Need mysql credentials for this";
}
}
my %args = (
type => 'MySQL',
lock_name => 'testlock',
make_new_dbh => sub {
my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host;port=$port", $usr, $pwd);
$dbh or die "Could not connect to database '$db'";
return $dbh;
( run in 0.253 second using v1.01-cache-2.11-cpan-4d50c553e7e )