Yusankyusank.hashnode.dev·Feb 22, 2022Go 语言实现连接池本篇介绍一个用 go 实现的连接池,针对连接的生命周期的管理十分有帮助。本篇从连接池的设计到实现以及常用场景进行详解。 1. 背景 连接池 可以说是在开发中非常的常见,各类我们需要与远端保持长连接从而提高服务性能(减少建立连接过程)。 如: 数据库连接池(MySQL,Redis等) 消息队列的连接池(即producer端提前建立连接,提升消息产生速率) 与其他远端服务保持长连接 如果使用一些常见的组件,其 client 端其实已经做好连接池了,我们初始化的时候仅需要设计池子大小,空闲时间等...26 readsGo LanguageAdd a thoughtful comment1 commentTop commentsYusankAuthor·Sep 2, 2022Author·Sep 2, 2022test 1·Reply