mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
update readme
This commit is contained in:
parent
a1b141d31a
commit
20d53add46
23
readme.md
23
readme.md
@ -76,12 +76,7 @@ go-zero是一个集成了各种工程实践的包含web和rpc框架,有如下
|
||||
|
||||
![弹性设计](doc/images/resilience.jpg)
|
||||
|
||||
## 4. go-zero近期开发计划
|
||||
|
||||
* 自动生成API mock server,便于客户端开发
|
||||
* 自动生成服务端功能测试
|
||||
|
||||
## 5. Installation
|
||||
## 4. Installation
|
||||
|
||||
在项目目录下通过如下命令安装:
|
||||
|
||||
@ -89,7 +84,7 @@ go-zero是一个集成了各种工程实践的包含web和rpc框架,有如下
|
||||
go get -u github.com/tal-tech/go-zero
|
||||
```
|
||||
|
||||
## 6. Quick Start
|
||||
## 5. Quick Start
|
||||
|
||||
0. 完整示例请查看
|
||||
|
||||
@ -143,13 +138,13 @@ go get -u github.com/tal-tech/go-zero
|
||||
...
|
||||
```
|
||||
|
||||
## 7. Benchmark
|
||||
## 6. Benchmark
|
||||
|
||||
![benchmark](doc/images/benchmark.png)
|
||||
|
||||
[测试代码见这里](https://github.com/smallnest/go-web-framework-benchmark)
|
||||
|
||||
## 8. 文档
|
||||
## 7. 文档
|
||||
|
||||
* API文档 (逐步完善中)
|
||||
|
||||
@ -169,4 +164,14 @@ go get -u github.com/tal-tech/go-zero
|
||||
|
||||
## 9. 微信交流群
|
||||
|
||||
加群之前有劳给一个star,一个小小的star是作者们回答海量问题的动力。
|
||||
|
||||
如果文档中未能覆盖的任何疑问,欢迎您在群里提出,我们会尽快答复。
|
||||
|
||||
您可以在群内提出使用中需要改进的地方,我们会考虑合理性并尽快修改。
|
||||
|
||||
如果您发现bug请及时提issue,我们及时修改。
|
||||
|
||||
扫码后请加群主,便于我邀请您进讨论群,并请退出扫码网关群,谢谢!
|
||||
|
||||
<img src="https://raw.githubusercontent.com/tal-tech/zero-doc/main/doc/images/wechat.jpg" alt="wechat" width="300" />
|
@ -16,12 +16,12 @@ func MaxConns(n int) func(http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
return func(next http.Handler) http.Handler {
|
||||
latchLimiter := syncx.NewLimit(n)
|
||||
latch := syncx.NewLimit(n)
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if latchLimiter.TryBorrow() {
|
||||
if latch.TryBorrow() {
|
||||
defer func() {
|
||||
if err := latchLimiter.Return(); err != nil {
|
||||
if err := latch.Return(); err != nil {
|
||||
logx.Error(err)
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user