Comments (5)
@zhangbo0724
客户端请求的锁是 读写锁,而且只加的读锁,以防在读的时候被改掉,读锁的性能很高的,这点暂时还不用担心
还有一点很重要的,加锁只是在 读一些参数时做的,真正发起请求,锁已经释放了,刚处理优化过这个问题
from gopay.
客户端请求的时候是带锁的,一个处理完处理另外一个,同时下单会阻塞
from gopay.
真实应用场景的时候肯定会有并发的需求,如果是同步执行的话就弱化了SDK的功能。只所以只实例化一个Client实例,是为了针对需要证书的请求时,避免频繁加载证书,但是单实例又会遇到并发的问题。希望后续可以完善SDK,考虑并发的场景。谢谢!
from gopay.
没必要担心这个问题,一次请求本身就挺快的了,1000人同时支付,你这业务量真大
from gopay.
为啥要加锁,看不明白。
只有存在竞态的业务,才需要锁。
支付的sdk,很显然,所有业务都不是竞态的。
代码的架构上,还是有一点问题的
from gopay.
Related Issues (20)
- init client setting err:decrypt downloaded certificate failed: crypto/aes: invalid key size 40
- alipay小程序。authcode 接口。返回openid 结构体缺失 HOT 2
- apple 在transaction 中增加 appAccountToken字段 HOT 1
- Paypal报错“Access Token not found in cache” HOT 2
- google pay HOT 3
- 支付宝批量转账接口还不能用吧 HOT 2
- 现在是否有计划考虑支持 stripe HOT 7
- 苹果内购的TransactionInfo 加了价格字段 price currency HOT 3
- 支付宝公钥模式(非证书模式) HOT 3
- 支付宝验签问题 HOT 1
- 是否支持微信H5支付, 在API定义里面没有找到
- 设置开启自动验签,是不是在回调接口就不用再次验证了? HOT 2
- 使用PostAliPayAPISelfV2调用后怎么验签 HOT 2
- 沙箱可以 线上模式 验签失败 HOT 1
- 微信支付 v3,灰度证书会导致验签失败 HOT 2
- 微信付款码支付,返回结果中包含html字段判断错误 HOT 2
- 支持支付宝接口AES加解密吗 HOT 4
- apple.VerifyReceipt() => 苹果支付校验收据API 报21003 HOT 2
- 2024/04/09 13:53:47.730283 notification_v2_test.go:24: [ERROR] >> x509: certificate has expired or is not yet valid: current time 2024-04-09T13:53:47+08:00 is after 2023-09-24T02:50:33Z HOT 4
- func (v *V3NotifyReq) DecryptCipherText(apiV3Key string) 这些解密文传的apiv3key到底是什么? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopay.