Documentation ¶
Overview ¶
Package flowcontrol implements a client side flow control mechanism
Package flowcontrol implements a client side flow control mechanism
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientManager ¶
type ClientManager struct {
// contains filtered or unexported fields
}
func NewClientManager ¶
func NewClientManager(rcTarget, maxSimReq, maxRcSum uint64) *ClientManager
func (*ClientManager) Stop ¶
func (self *ClientManager) Stop()
type ClientNode ¶
type ClientNode struct {
// contains filtered or unexported fields
}
func NewClientNode ¶
func NewClientNode(cm *ClientManager, params *ServerParams) *ClientNode
func (*ClientNode) AcceptRequest ¶
func (peer *ClientNode) AcceptRequest() (uint64, bool)
func (*ClientNode) Remove ¶
func (peer *ClientNode) Remove(cm *ClientManager)
func (*ClientNode) RequestProcessed ¶
func (peer *ClientNode) RequestProcessed(cost uint64) (bv, realCost uint64)
type ServerNode ¶
type ServerNode struct {
// contains filtered or unexported fields
}
func NewServerNode ¶
func NewServerNode(params *ServerParams) *ServerNode
func (*ServerNode) CanSend ¶
func (peer *ServerNode) CanSend(maxCost uint64) uint64
func (*ServerNode) GotReply ¶
func (peer *ServerNode) GotReply(reqID, bv uint64)
func (*ServerNode) SendRequest ¶
func (peer *ServerNode) SendRequest(reqID, maxCost uint64)
blocks until request can be sent
type ServerParams ¶
type ServerParams struct {
BufLimit, MinRecharge uint64
}
Click to show internal directories.
Click to hide internal directories.