PHPackages                             foxtech6/mutex-locker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. foxtech6/mutex-locker

Abandoned → [foxtech6/mutexsafe](/?search=foxtech6%2Fmutexsafe)Library[Utility &amp; Helpers](/categories/utility)

foxtech6/mutex-locker
=====================

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.

v1.0(6y ago)161471MITPHPPHP ^7.1

Since Jun 16Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/foxtech6/mutexsafe)[ Packagist](https://packagist.org/packages/foxtech6/mutex-locker)[ RSS](/packages/foxtech6-mutex-locker/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (1)Versions (24)Used By (0)

MutexSafe
=========

[](#mutexsafe)

### Manage locks effectively and faster | With PHP7

[](#manage-locks-effectively-and-faster--with-php7)

 [![logo](mutexsafe.jpg)](mutexsafe.jpg)

[![Latest Stable Version](https://camo.githubusercontent.com/35cd71b7aafb3f619283d56fbf553e4df651ff008ff751b49599270c7b00a86d/68747470733a2f2f706f7365722e707567782e6f72672f666f7874656368362f6d757465782d6c6f636b65722f76)](https://packagist.org/packages/foxtech6/mutex-locker#v1.0)[![Total Downloads](https://camo.githubusercontent.com/39015051023824ceffad17b12a001a7f5ce0ae5afc0d92d4e6f6293dc63560a3/68747470733a2f2f706f7365722e707567782e6f72672f666f7874656368362f6d757465782d6c6f636b65722f646f776e6c6f616473)](https://packagist.org/packages/foxtech6/mutex-locker/stats)[![License](https://camo.githubusercontent.com/390e2e70990bb3a8d93e8bbe66403205b201f65a83d8a09cd18b9c490622032e/68747470733a2f2f706f7365722e707567782e6f72672f666f7874656368362f6d757465782d6c6f636b65722f6c6963656e7365)](https://github.com/foxtech6/mutex-locker/blob/master/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
----------

[](#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](https://github.com/foxtech6/mutex-locker/blob/master/src/foxtech/MutexInterface.php))

```
$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
-------

[](#license)

[MIT](https://github.com/foxtech6/mutex-locker/blob/master/LICENSE)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance44

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Total

3

Last Release

2410d ago

Major Versions

v0.0.2 → v1.02019-10-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/020cd928776c3f771fb67f69082bbb87d52888ef4121a9bd131b1cc29fcac0ed?d=identicon)[foxtech](/maintainers/foxtech)

---

Top Contributors

[![foxtech6](https://avatars.githubusercontent.com/u/18751965?v=4)](https://github.com/foxtech6 "foxtech6 (127 commits)")[![cara-hack](https://avatars.githubusercontent.com/u/31210619?v=4)](https://github.com/cara-hack "cara-hack (31 commits)")

---

Tags

flockhacktoberfestlocklockerlockingmemcached-lockmutexpdo-lockphpredis-lockphpmutexlockingflocklocklockerredis lockpdo-lockmemcached-lock

### Embed Badge

![Health badge](/badges/foxtech6-mutex-locker/health.svg)

```
[![Health](https://phpackages.com/badges/foxtech6-mutex-locker/health.svg)](https://phpackages.com/packages/foxtech6-mutex-locker)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514127.6M459](/packages/symfony-lock)[malkusch/lock

Mutex library for exclusive code execution.

9459.6M27](/packages/malkusch-lock)[arvenil/ninja-mutex

Simple to use mutex implementation that can use flock, memcache, memcached, mysql or redis for locking

1873.7M27](/packages/arvenil-ninja-mutex)[pudongping/hyperf-wise-locksmith

A mutex library provider for the Hyperf framework, designed to enable serialized execution of PHP code in high-concurrency scenarios.

106.3k2](/packages/pudongping-hyperf-wise-locksmith)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
