Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

tristanwietsma/netpool

Repository files navigation

netpool

Build Status GoDoc

Connection Pool

Install

go get github.com/tristanwietsma/netpool

Usage

Create a connection pool

p, err := netpool.NewConnectionPool("<type>", "<server ip address>", <pool size>)

Get a connection from the pool

c, err := p.Connect()

Use a connection

Connections implement Write and Read.

err := c.Write([]byte("ping"))
msg, err := c.Read()

Return a connection to the pool

p.Release(c)

Testing

Build and start the echoServer, then go test as normal.

Releases

No releases published

Packages

No packages published

Languages