flowcontrol

package
v1.5.5-0...-86f9e83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2016 License: GPL-3.0 Imports: 3 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL