webgriffe/payum-lock-request-extension
Composer 安装命令:
composer require webgriffe/payum-lock-request-extension
包简介
A Payum extension providing the ability to lock concurrent requests.
README 文档
README
A Payum extension providing the ability to lock concurrent requests
This extension provides the ability to lock concurrent requests to a Payum gateway (for example when the PSP send both a notify action and a traditional capture action in the same moment). It uses Symfony Lock Component to provide a simple and reliable locking mechanism.
Installation
composer require webgriffe/payum-lock-request-extension
Usage
<?php // Use your preferred \Symfony\Component\Lock\PersistingStoreInterface implementation $persistingStore = new Symfony\Component\Lock\Store\SemaphoreStore(); $lockFactory = new \Symfony\Component\Lock\LockFactory($persistingStore); $lockRequestExtension = new \Webgriffe\PayumLockRequestExtension\LockRequestExtension( $lockFactory, 'my_lock_prefix', // Optional, default value is 'webgriffe_payum_lock_request_extension' 30.0, // Optional, default value is 30.0 true // Optional, default value is true ); /** @var \Payum\Core\Gateway $gateway */ $gateway->addExtension($lockRequestExtension); // here the extension will be called to wrap the execute acton in a lock $gateway->execute(new FooRequest);
Configuration
The extension can be configured with the following options:
- Lock prefix: to ensure lock key is unique, default is
webgriffe_payum_lock_request_extension. - Lock TTL: the maximum time in seconds that a lock can be hold, default is
30. - Lock autorelease: release the lock or not when the lock instance is destroyed, default is
true.
webgriffe/payum-lock-request-extension 适用场景与选型建议
webgriffe/payum-lock-request-extension 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.7k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 webgriffe/payum-lock-request-extension 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webgriffe/payum-lock-request-extension 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-17