ConnPool — screenshot of github.com

ConnPool

This is a thread-safe connection pool for Go's `net.Conn` interface, which I found useful for managing and reusing network connections. It's a maintained fork addressing issues in `fatih/pool`.

Visit github.com →

Questions & Answers

What is ConnPool?
ConnPool is a thread-safe connection pooling library for Go's `net.Conn` interface. It enables the management and reuse of network connections to improve performance and resource utilization.
Who should use buraksezer/connpool?
Developers building Go applications that frequently establish and close network connections, especially to remote services, can use ConnPool to efficiently manage these connections and reduce overhead.
How does ConnPool compare to other Go connection pools?
ConnPool is a maintained fork of `fatih/pool`, specifically addressing known bugs (fatih/pool#26, fatih/pool#27) that were critical for its use in projects like `buraksezer/olric`.
When is it appropriate to use a connection pool like ConnPool?
A connection pool is appropriate when an application frequently needs to connect to a service (e.g., a database, cache, or other network endpoint) and re-establishing connections incurs significant overhead.
How do you mark a connection from ConnPool as unusable?
A connection retrieved from the pool can be marked as unusable by casting it to `*connpool.PoolConn` and calling `pc.MarkUnusable()` before `pc.Close()`. This prevents the underlying connection from being returned to the pool.