tinywan/webman-lock

Webman plugin tinywan/webman-lock

v0.0.2 2024-04-12 09:50 UTC

This package is auto-updated.

Last update: 2024-10-12 11:08:50 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

安装

composer require tinywan/webman-lock

使用

// 锁名称
$lockName = md5((string) time());
// 锁标识
$lockId = \Tinywan\Lock\RedisLock::acquire($lockName);
if (!$lockId) {
    return '未获得锁标识,请稍后再试';
}

// 业务处理

// 释放锁
\Tinywan\Lock\RedisLock::release($lockName, $lockId);