All Projects → foxtech6 → mutexsafe

foxtech6 / mutexsafe

Licence: MIT license
MutexSafe will help you use mutex more effectively. Different mutex for different components are presented. In addition, you can add your own lockers and use within the library.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to mutexsafe

futex
File-based Ruby Mutex
Stars: ✭ 14 (-6.67%)
Mutual labels:  lock, locking, mutex
go-lock
go-lock is a lock library implementing read-write mutex and read-write trylock without starvation
Stars: ✭ 78 (+420%)
Mutual labels:  lock, mutex, locker
pglock
PostgreSQL Lock Client for Go
Stars: ✭ 50 (+233.33%)
Mutual labels:  lock, locking
php-peek-lock
A wrapper around flock()
Stars: ✭ 18 (+20%)
Mutual labels:  lock, flock
LockerScreen
Android lock screen,slide to unlock ! 安卓锁屏,上滑解锁,效果酷炫,值得拥有!
Stars: ✭ 81 (+440%)
Mutual labels:  lock, locker
distlock
The universal component of distributed locks in golang , support redis and postgresql
Stars: ✭ 60 (+300%)
Mutual labels:  lock, mutex
mutex
Mutex lock implementation
Stars: ✭ 28 (+86.67%)
Mutual labels:  lock, mutex
async
Synchronization and asynchronous computation package for Go
Stars: ✭ 104 (+593.33%)
Mutual labels:  lock, mutex
slow-down
A centralized Redis-based lock to help you wait on throttled resources
Stars: ✭ 21 (+40%)
Mutual labels:  lock, redis-lock
AtomicKit
Concurrency made simple in Swift.
Stars: ✭ 88 (+486.67%)
Mutual labels:  lock, mutex
run exclusive
⚡🔒 Wait queue for function execution 🔒 ⚡
Stars: ✭ 22 (+46.67%)
Mutual labels:  lock, mutex
lockbot
🔒 Coordinate use of your team's shared resources, in Slack 🤝
Stars: ✭ 47 (+213.33%)
Mutual labels:  mutex
Concurrent
Functional Concurrency Primitives
Stars: ✭ 206 (+1273.33%)
Mutual labels:  lock
Ninja Mutex
Mutex implementation for PHP
Stars: ✭ 180 (+1100%)
Mutual labels:  lock
React Focus On
🎯 Solution for WAI ARIA compatible modal dialogs or full-screen tasks, you were looking for
Stars: ✭ 180 (+1100%)
Mutual labels:  lock
ci
Run npm ci using the appropriate Node package manager (npm, yarn, pnpm)
Stars: ✭ 39 (+160%)
Mutual labels:  lock
ES-Timer
A USB timer powered by Digispark ATtiny85 according to 🍅 pomodoro time management technique
Stars: ✭ 45 (+200%)
Mutual labels:  lock
Java Concurrency Examples
Java Concurrency/Multithreading Tutorial with Examples for Dummies
Stars: ✭ 173 (+1053.33%)
Mutual labels:  lock
Aioredlock
🔒 The asyncio implemetation of Redis distributed locks
Stars: ✭ 171 (+1040%)
Mutual labels:  lock
Jxpatternlock
An easy-to-use, powerful, customizable pattern lock view in swift. 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码
Stars: ✭ 165 (+1000%)
Mutual labels:  lock

MutexSafe

Manage locks effectively and faster | With PHP7

logo

Latest Stable Version Total Downloads License

  • This library will help you use mutex more effectively.
  • Different mutex for different components are presented.
  • In addition, you can add your own lockers and use within the library.

How to use

$customHandler = new \CustomHandler(/* some parameters */);

// You can send the handler directly to the constructor
$factory = new \Foxtech\Competitor($customHandler);

/* OR */

// via the setHandler method
$factory = new \Foxtech\Competitor();
$factory->setHandler($customHandler);

$timeout = 50;//seconds
$factory->getMutex('mutex_name')->acquire($timeout /* default timeout - 30 seconds */);

// some code

$factory->getMutex('mutex_name')->release();

You can also write your own mutex to a custom handler and use within our library.(Important: Your mutex must implement our interface)

$yourCustomHandler = new YourCustomHandler();

$factory = new \Foxtech\Competitor();
$factory->push(YourCustomHandler::class, YourMutex::class);
$factory->setHandler($yourCustomHandler);

$factory->getMutex('mutex_name')->acquire();

// some code

$factory->getMutex('mutex_name')->release();

PDO Handler

$pdo = new \PDO('mysql:host=localhost;dbname=test', 'root', 'toor');

$factory = new \Foxtech\Competitor($pdo);

$factory->getMutex('mutex_name')->acquire();

// some code

$factory->getMutex('mutex_name')->release();

License

MIT

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].