tsfcorp/mysql-lock

Provides a locking mechanism using mysql

Installs: 939

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 1

Open Issues: 0

pkg:composer/tsfcorp/mysql-lock

v0.0.3 2019-11-18 14:31 UTC

This package is auto-updated.

Last update: 2025-10-07 19:44:01 UTC


README

Installation

Require this package in your composer.json and update composer. Run the following command:

composer require tsfcorp/mysql-lock

After updating composer, the service provider will automatically be registered and enabled, along with the facade, using Auto-Discovery

Usage Instructions

MysqlLock library can be used when you don't want two processes to overlap

if ( ! MysqlLock::get($lock_name))
{
    // a lock already exists. Please try again later
}

Make sure that at the end of your script to always release the lock:

MysqlLock::release($lock_name);