Documentation
¶
Index ¶
- Constants
- type DefaultConnPool
- func (dc *DefaultConnPool) Close() error
- func (dc *DefaultConnPool) Discard(conn *LongConn) error
- func (dc *DefaultConnPool) Get(ctx context.Context, address string) (*LongConn, error)
- func (dc *DefaultConnPool) Open()
- func (dc *DefaultConnPool) Put(conn *LongConn) error
- func (dc *DefaultConnPool) RequestMessage(msg protoreflect.ProtoMessage, timeout int64) (proto.Message, error)
- func (dc *DefaultConnPool) Tick()
- type Future
- type LongConn
- func (c *LongConn) Close()
- func (c *LongConn) Dial(addr string, timeout time.Duration) error
- func (c *LongConn) EscalateFailure(reason interface{}, message interface{})
- func (c *LongConn) IsConnected() bool
- func (c *LongConn) RequestMessage(message proto.Message, timeout int64) (proto.Message, error)
- type LongConnDirect
- type LongConnLinkedNode
- type LongConnPool
- type LongConnPoolConfig
- type LongConnState
Constants ¶
View Source
const ( LCS_Disconnected = iota LCS_Connecting LCS_Connected LCS_Disconnecting )
View Source
const ( LCS_Unknown = iota LCS_Idle LCS_Busy )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultConnPool ¶
type DefaultConnPool struct {
// contains filtered or unexported fields
}
func NewDefaultConnPool ¶
func NewDefaultConnPool(address string, idlConfig LongConnPoolConfig) *DefaultConnPool
func (*DefaultConnPool) Close ¶
func (dc *DefaultConnPool) Close() error
func (*DefaultConnPool) Discard ¶
func (dc *DefaultConnPool) Discard(conn *LongConn) error
func (*DefaultConnPool) Open ¶
func (dc *DefaultConnPool) Open()
func (*DefaultConnPool) Put ¶
func (dc *DefaultConnPool) Put(conn *LongConn) error
func (*DefaultConnPool) RequestMessage ¶
func (dc *DefaultConnPool) RequestMessage(msg protoreflect.ProtoMessage, timeout int64) (proto.Message, error)
func (*DefaultConnPool) Tick ¶
func (dc *DefaultConnPool) Tick()
type LongConn ¶
type LongConn struct { LongConnLinkedNode // contains filtered or unexported fields }
func NewLongConn ¶
func NewLongConn(ascription LongConnPool, usedLastTime int64) *LongConn
func (*LongConn) EscalateFailure ¶
func (c *LongConn) EscalateFailure(reason interface{}, message interface{})
func (*LongConn) IsConnected ¶
type LongConnDirect ¶
type LongConnDirect int
type LongConnLinkedNode ¶
type LongConnLinkedNode struct {
intrusive.LinkedNode
}
type LongConnPool ¶
type LongConnPoolConfig ¶
type LongConnPoolConfig struct { MaxConn int32 // 最大连接数 MaxIdleConn int32 // 最大空闲连接数 MaxIdleConnTimeout time.Duration // 空闲连接最大闲置时间 ConnectTimeout time.Duration // 连接超时时间 }
func CheckLongConnPoolConfig ¶
func CheckLongConnPoolConfig(config LongConnPoolConfig) *LongConnPoolConfig
type LongConnState ¶
type LongConnState int
Source Files
¶
Click to show internal directories.
Click to hide internal directories.