Golang redigo 使用笔记 (二):并发处理和连接池
一、并发问题 在 redigo 官方的文档描述中,Receive() 方法是不支持多并发的,原文为:
|
1 |
Connections support one concurrent caller to the Receive method and one concurrent caller to the Send and Flush methods. No other concurrency is supported including concurrent calls to the Do method. |
而 Do() 方法是间接调用了 Receive() 方法,所以 Do() 方法也是不支持多并发的。我们可以用一段代码来验证这一点: [crayon-6 ... 阅读更多