Youngyezi / mutex by Youngyezi

Redis mutex for Lumen,Lumen 分布式锁
7
0
2
Package Data
Maintainer Username: Youngyezi
Package Create Date: 2018-12-27
Package Last Update: 2018-12-27
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2025-01-15 03:03:09
Package Statistics
Total Downloads: 7
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Redis mutex for Lumen

redis 分布式锁

install

composer require youngyezi/mutex 

		

usge

use Youngyezi\Mutex\Mutex;


$mutex = new Mutex();

if( $mutex->lock("test") ) {

    //do something
    
    ...
    
    $mutex->unlock("test");
}