Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EndpointRestrictedConnPool ¶
type EndpointRestrictedConnPool interface { Get() (gnet.Conn, error) Put(conn gnet.Conn, err error) UpdateEndpoints(all, add, del []string) NumPooled() int }
EndpointRestrictedConnPool is the interface of a simple endpoint restricted connection pool that the connection's remote address must be in an endpoint list, if not, it will be closed and can not be used anymore, it is useful for holding the connections to a service whose endpoints can be changed at runtime.
func NewConnPool ¶
func NewConnPool(initEndpoints []string, connsPerEndpoint, size int, dialer Dialer, log logger.Logger) (EndpointRestrictedConnPool, error)
NewConnPool news a EndpointRestrictedConnPool
Click to show internal directories.
Click to hide internal directories.