定制 dennis/php-redis-lock 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dennis/php-redis-lock

Composer 安装命令:

composer require dennis/php-redis-lock

包简介

README 文档

README

Connecting to Redis:

RedisLock::connect('tcp://host:port');

Or to just connect to localhost and default port:

RedisLock::connect();

Acquiring a Lock:

$lock = RedisLock::lock('resource');
if($lock) {
    doSomething();
}

This will attempt to acquire a lock for the named resource. If successful, the return value is a RedisLock object. If the resource was already locked, the return value will be +false+.

Releasing the Lock:

RedisLock::release($lock);

Make sure to release the lock once you're done with it, so another client can acquire it.

Lock Expiration

If your client acquires a lock and then dies before releasing it, the lock will expire after a certain amount of time (default 5 minutes). You can set your own lock expiration when acquiring the lock like so: $lock = RedisLock::lock('resource', $expiration_in_seconds);

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固