PHPackages                             pudongping/hyperf-wise-locksmith - 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. pudongping/hyperf-wise-locksmith

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pudongping/hyperf-wise-locksmith
================================

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

3.0.0(1y ago)107.5k↓28.4%2MITPHPPHP &gt;=8.1

Since Aug 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pudongping/hyperf-wise-locksmith)[ Packagist](https://packagist.org/packages/pudongping/hyperf-wise-locksmith)[ Docs](https://github.com/pudongping/hyperf-wise-locksmith)[ RSS](/packages/pudongping-hyperf-wise-locksmith/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (2)

[Requirements](#requirements) | [Installation](#installation) | [Branches or tags](#branches-or-tags) | [Quickstart](#quickstart) | [Note](#note) | [Documentation](#documentation) | [Contributing](#contributing) | [License](#license)

hyperf-wise-locksmith
=====================

[](#hyperf-wise-locksmith)

[![Latest Stable Version](https://camo.githubusercontent.com/657d063895ba5b3794cd59298a9be5260212d38267071c3e448d5ca232df4226/68747470733a2f2f706f7365722e707567782e6f72672f7075646f6e6770696e672f6879706572662d776973652d6c6f636b736d6974682f762f737461626c652e737667)](https://packagist.org/packages/pudongping/hyperf-wise-locksmith)[![Total Downloads](https://camo.githubusercontent.com/3c3b661e0be8ede62b98cd53da383cf07ff58d5ee7719c82eedde269754b9480/68747470733a2f2f706f7365722e707567782e6f72672f7075646f6e6770696e672f6879706572662d776973652d6c6f636b736d6974682f646f776e6c6f6164732e737667)](https://packagist.org/packages/pudongping/hyperf-wise-locksmith)[![Latest Unstable Version](https://camo.githubusercontent.com/3e60dd975a7d255df6234ed99a69560efaf616fa16d0f87b7e0cae8936bac58a/68747470733a2f2f706f7365722e707567782e6f72672f7075646f6e6770696e672f6879706572662d776973652d6c6f636b736d6974682f762f756e737461626c652e737667)](https://packagist.org/packages/pudongping/hyperf-wise-locksmith)[![Minimum PHP Version](https://camo.githubusercontent.com/f53e57bdfcce7ee7b368330a9377e20d6adf7491aac467876e3de15cacf3dd21/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)](https://php.net/)[![Packagist](https://camo.githubusercontent.com/9ad31ffbb65ce74c5c43a98002be95262e79742b15e5b326fca5148087ee34a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7075646f6e6770696e672f6879706572662d776973652d6c6f636b736d6974682e737667)](https://github.com/pudongping/hyperf-wise-locksmith)[![License](https://camo.githubusercontent.com/936cd0c16d9bf5d081fdc99a928d51bcd26f86c47220d7123068dd2e4870cd55/68747470733a2f2f706f7365722e707567782e6f72672f7075646f6e6770696e672f6879706572662d776973652d6c6f636b736d6974682f6c6963656e7365)](https://packagist.org/packages/pudongping/hyperf-wise-locksmith)

English | [中文](./README-ZH.md)

🔒 A mutex library provider for the Hyperf framework, designed to enable serialized execution of PHP code in high-concurrency scenarios. This library is based on [pudongping/wise-locksmith](https://github.com/pudongping/wise-locksmith).

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- hyperf ~3.1.0

Installation
------------

[](#installation)

```
composer require pudongping/hyperf-wise-locksmith:^3.0 -vvv
```

Branches or tags
----------------

[](#branches-or-tags)

### Branch

[](#branch)

- **2.2:** For hyperf 2.2
- **3.0:** For hyperf ~3.0
- **3.1:** For hyperf ~3.1

### Tag

[](#tag)

- **1.0.x:** For hyperf 2.2
- **2.0.x:** For hyperf 3.0
- **3.0.x:** For hyperf 3.1

Quickstart
----------

[](#quickstart)

Below, an example of deducting user balances in a high-concurrency scenario will be provided to demonstrate the functionality and usage of this library.

Create the `app\Controller\BalanceController.php` file and write the following code:

```
