Documentation ¶
Index ¶
Constants ¶
View Source
const ( AlwaysNewConn connReuseStrategy = iota CachedOrNewConn )
Variables ¶
View Source
var ErrBadConn = errors.New("bad connection")
Functions ¶
func NewConnectionPool ¶
func NewConnectionPool(ctx context.Context, addrs, protocol string, frame, buffered bool, factory Factory) (*connectionPool, error)
@addrs: server地址,逗号分隔,eg: 127.0.0.1:2000,127.0.0.2:3000 @protocol: Specify the protocol (binary, compact, json, simplejson) @frame: Use framed transport @buffered: Use buffered transport
Types ¶
type Connection ¶
type Connection struct { sync.Mutex ThriftClient interface{} // this is what we return in Get // contains filtered or unexported fields }
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Release ¶
func (c *Connection) Release(err error)
Click to show internal directories.
Click to hide internal directories.