All Projects → yriveiro → php-fslock

yriveiro / php-fslock

Licence: MIT license
A simple lock implementation using flock.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-fslock

Foundatio
Pluggable foundation blocks for building distributed apps.
Stars: ✭ 1,365 (+7483.33%)
Mutual labels:  lock
Lock Threads
GitHub Action that locks closed issues and pull requests after a period of inactivity
Stars: ✭ 156 (+766.67%)
Mutual labels:  lock
Ninja Mutex
Mutex implementation for PHP
Stars: ✭ 180 (+900%)
Mutual labels:  lock
Live Mutex
High-performance networked mutex for Node.js libraries.
Stars: ✭ 118 (+555.56%)
Mutual labels:  lock
React Locky
"🔒-y" – Asgardian God of Event Scoping 📦, Scroll Locking 📜, Silence Casting 🙊
Stars: ✭ 141 (+683.33%)
Mutual labels:  lock
Jxpatternlock
An easy-to-use, powerful, customizable pattern lock view in swift. 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码
Stars: ✭ 165 (+816.67%)
Mutual labels:  lock
Plock
🔐PLock is a simple and efficient cross-process lock, also support read-write lock. (简单高效的跨进程锁,支持读写锁分离)
Stars: ✭ 96 (+433.33%)
Mutual labels:  lock
Lock.swift
A Swift & iOS framework to authenticate using Auth0 and with a Native Look & Feel
Stars: ✭ 215 (+1094.44%)
Mutual labels:  lock
Composer Lock Diff
See what has changed after a composer update
Stars: ✭ 154 (+755.56%)
Mutual labels:  lock
React Focus On
🎯 Solution for WAI ARIA compatible modal dialogs or full-screen tasks, you were looking for
Stars: ✭ 180 (+900%)
Mutual labels:  lock
Lock.android
Android Library to authenticate using Auth0 and with a Native Look & Feel
Stars: ✭ 121 (+572.22%)
Mutual labels:  lock
Node Proper Lockfile
An inter-process and inter-machine lockfile utility that works on a local or network file system.
Stars: ✭ 139 (+672.22%)
Mutual labels:  lock
Aioredlock
🔒 The asyncio implemetation of Redis distributed locks
Stars: ✭ 171 (+850%)
Mutual labels:  lock
Poetry Pycharm Plugin
A PyCharm plugin for poetry
Stars: ✭ 113 (+527.78%)
Mutual labels:  lock
Concurrent
Functional Concurrency Primitives
Stars: ✭ 206 (+1044.44%)
Mutual labels:  lock
Suohai
Audio input/output source lock/switcher for macOS.
Stars: ✭ 100 (+455.56%)
Mutual labels:  lock
Easy
开源的Java开发脚手架,工作经验总结,springboot,springcloud,基于tk-mybatis代码反向生成,基于redis(redisson)注解形式加分布式锁等,计划将用该脚手架抄袭jeesite和ruoyi还有基于vue的后台权限管理系统做一套开源的后台管理和cms系统,域名服务器已买好,脚手架还在继续更新中,更新完毕开始更新easysite
Stars: ✭ 160 (+788.89%)
Mutual labels:  lock
Javainterview
java中高级基础指南
Stars: ✭ 222 (+1133.33%)
Mutual labels:  lock
Pottery
Redis for humans. 🌎🌍🌏
Stars: ✭ 204 (+1033.33%)
Mutual labels:  lock
Java Concurrency Examples
Java Concurrency/Multithreading Tutorial with Examples for Dummies
Stars: ✭ 173 (+861.11%)
Mutual labels:  lock

FSLock

Build Status Coverage Status Total Downloads

A simple lock implementation using flock.

NOTE: to use php-backoff with PHP 5.x please use the lastet release of branch 2.x

Usage

use FSLock\FSLock;

$lock = new FSLock('test');

if ($lock->acquire()) {
    // Critical code.

    $lock->release();
}

If you want to use a custom path to store the locks, you should instantiate the FSLock like that

$lock = new FSLock('test', '/tmp/');

API

  • acquire: Acquires the lock, returns true if the operation was successful otherwise the return is false.
  • release: Releases the lock, returns true if the operation was successful otherwise the return is false.
  • id: returns the lock id.
  • getPath: returns the lock path

Install

The recommended way to install this package is through Composer.

composer require yriveiro/php-fslock:3.0.0

Tests

Tests are performed using the phpunit library, to run them:

php vendor/bin/phpunit tests

License

FSLock is licensed under MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].