PHPackages                             icecave/chastity - 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. [Caching](/categories/caching)
4. /
5. icecave/chastity

ActiveLibrary[Caching](/categories/caching)

icecave/chastity
================

Distributed advisory locking for PHP.

0.1.3(11y ago)1513.3k1[1 issues](https://github.com/IcecaveStudios/chastity/issues)MITPHPPHP &gt;=5.5

Since Nov 17Pushed 11y ago3 watchersCompare

[ Source](https://github.com/IcecaveStudios/chastity)[ Packagist](https://packagist.org/packages/icecave/chastity)[ Docs](https://github.com/IcecaveStudios/chastity)[ RSS](/packages/icecave-chastity/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (7)Used By (0)

Chastity
========

[](#chastity)

[![Build Status](https://camo.githubusercontent.com/fffae6b2fc8ad82fa3ee86d6ae795a6d843803e55d640db62ed50329b3d4ae69/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f4963656361766553747564696f732f63686173746974792f646576656c6f702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/IcecaveStudios/chastity)[![Test Coverage](https://camo.githubusercontent.com/db02b15880d3d2ebcee27156db508edc6276ed214b6abd600b9e81978a5e5299/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4963656361766553747564696f732f63686173746974792f646576656c6f702e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/IcecaveStudios/chastity?branch=develop)[![SemVer](https://camo.githubusercontent.com/833cfa01b8cdf594af0cd63f626eaad95115cd19949d4a84f7688d70affcc34e/687474703a2f2f696d672e736869656c64732e696f2f3a73656d7665722d302e312e332d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](http://semver.org)

**Chastity** provides an abstraction for acquiring and releasing advisory locks in a distributed environment.

- Install via [Composer](http://getcomposer.org) package [icecave/chastity](https://packagist.org/packages/icecave/chastity)
- Read the [API documentation](http://icecavestudios.github.io/chastity/artifacts/documentation/api/)

Drivers
-------

[](#drivers)

- [Redis](src/Driver/Redis)
- Redlock (not yet implemented)
- PDO (not yet implemented)
- MySQL advisory locks (not yet implemented)

Examples
--------

[](#examples)

- [Acquiring a lock](examples/acquire)
- [Extending an already acquired lock](examples/acquire)

Contact us
----------

[](#contact-us)

- Follow [@IcecaveStudios](https://twitter.com/IcecaveStudios) on Twitter
- Visit the [Icecave Studios website](http://icecave.com.au)
- Join `#icecave` on [irc.freenode.net](http://webchat.freenode.net?channels=icecave)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.1% 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 ~28 days

Total

4

Last Release

4114d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93a71bd75fcd51efee464532dbdd54927cd00e938805998c76e0a804d38fa3fb?d=identicon)[jmalloc](/maintainers/jmalloc)

---

Top Contributors

[![jmalloc](https://avatars.githubusercontent.com/u/761536?v=4)](https://github.com/jmalloc "jmalloc (35 commits)")[![koden-km](https://avatars.githubusercontent.com/u/1037307?v=4)](https://github.com/koden-km "koden-km (2 commits)")[![elazar](https://avatars.githubusercontent.com/u/15487?v=4)](https://github.com/elazar "elazar (1 commits)")

---

Tags

redismutexlockdistributedadvisoryexclusive

### Embed Badge

![Health badge](/badges/icecave-chastity/health.svg)

```
[![Health](https://phpackages.com/badges/icecave-chastity/health.svg)](https://phpackages.com/packages/icecave-chastity)
```

###  Alternatives

[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)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)[resque/php-resque

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

2371.8M7](/packages/resque-php-resque)[javibravo/simpleue

Php package to manage queue tasks in a simple way

130332.1k1](/packages/javibravo-simpleue)[rtckit/react-redlock

Asynchronous distributed locks with Redis and ReactPHP

177.8k1](/packages/rtckit-react-redlock)

PHPackages © 2026

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