承接 swordev/mutex 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

swordev/mutex

Composer 安装命令:

composer require swordev/mutex

包简介

Read-write concurrency control

README 文档

README

Read-write concurrency control

Installation

composer require @swordev/mutex

Usage

File read/write lock

use Swordev\Mutex\FileMutex;

$mutex1 = new FileMutex('key');
$mutex2 = new FileMutex('key');

$mutex1->readLock(); // true
$mutex2->writeLock(); // false

$mutex1->unlock(); // true
$mutex2->writeLock(); // true

Timeout

use Swordev\Mutex\FileMutex;

$mutex = new FileMutex('key');
$mutex->writeLock(5000);

Contextual lock

use Swordev\Mutex\FileMutex;

class Foo {
	function method() {
		$mutex = new FileMutex(__CLASS__ . '|' . __FUNCTION__);
		$mutex->writeLock();
		// ...
	}
}

Mutex factory

use Swordev\Mutex\MutexFactory;

$mutex = new MutexFactory::create(FileMutex::class, 'key');

Development

Test

composer run test

Analyse

composer run analyse

Author

Juanra GM - https://github.com/juanrgm

Distributed under the MIT license.

https://github.com/swordev/mutex-php

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固