IPC::ConcurrencyLimit::Lock::MySQL - Locking via MySQL GET_LOCK
This locking strategy uses MySQL's
GET_LOCK to implement locking across multiple hosts.
Given a hash ref with options, attempts to obtain a lock in the pool. On success, returns the lock object, otherwise undef.
The name prefix for the named
GET_LOCK locks to use. Make sure this doesn't collide with any other locks.
A code reference that, when called, will return a NEW database handle for use in locking. If it returns a handle that is used for other purposes as well, there can be strange action at a distance since MySQL allow exactly one lock at a time per connection. If a second
GET_LOCK is issued for the same connection, the old lock will be silently released!
The maximum no. of locks (and thus usually processes) to allow at one time.
The time-out in seconds when trying to obtain a lock. Defaults to 0, non-blocking.
This module was originally developed for booking.com. With approval from booking.com, this module was generalized and put on CPAN, for which the author would like to express his gratitude.
(C) 2011 Steffen Mueller. All rights reserved. This code is available under the same license as Perl version 5.8.1 or higher. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.