Documentation ¶
Overview ¶
Package conpool implements connection pooling based on assigning a context (typically, a channel) to a specific connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Con ¶
type Con struct {
// contains filtered or unexported fields
}
Con is a single, reusable connection.
type MessageHandler ¶
type MessageHandler interface { Connected(c *Con) Message(c *Con, msg *ircon.Message) Disconnected(c *Con, err error) }
A MessageHandler handles messages in the context of a connection, taking care not to block unnecessarily long.
type Pool ¶
type Pool struct { MaxPerPool int // contains filtered or unexported fields }
Pool is a pool of zero or more connections. Accessing the connection pool is not concurrency safe.
func New ¶
func New(login, oauth string, mh MessageHandler) *Pool
func (*Pool) Assign ¶
Assign assigns a target to a connection.
func (*Pool) ConForTarget ¶
ConForTarget returns a connection session that (ideally) relates to the given target.
Click to show internal directories.
Click to hide internal directories.