proxy

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallMap

type CallMap map[uint32]*ProxyCall

type ProxyCall

type ProxyCall struct {
	CallID  uint32      //proxy call uuid, do not modify
	ProxyId ProxyUuid   //proxy instance id
	ReqData []byte      //serizaled data of rpc request
	Ch      chan []byte //response notify channel

	MethodId uint32 // method id 提供给日志使用
	// contains filtered or unexported fields
}

ProxyCall rpc-proxy call information of remote call description

func (*ProxyCall) DecRetryTime

func (pc *ProxyCall) DecRetryTime()

DecRetryTime decrease retry time, read & write in worker goroutine

func (*ProxyCall) DoRet

func (pc *ProxyCall) DoRet(body []byte)

func (ProxyCall) GetErrorCode added in v0.3.4

func (pc ProxyCall) GetErrorCode() uint32

func (*ProxyCall) GetRetryTime

func (pc *ProxyCall) GetRetryTime() int32

GetRetryTime get left retry time

func (*ProxyCall) GetTimeOut

func (pc *ProxyCall) GetTimeOut() uint32

GetTimeOut timeout millisecond

func (*ProxyCall) GlobalIndex added in v0.3.4

func (pc *ProxyCall) GlobalIndex() protocol.GlobalIndexType

func (*ProxyCall) SetErrorCode

func (pc *ProxyCall) SetErrorCode(errCode uint32)

func (*ProxyCall) SetGlobalIndex added in v0.3.4

func (pc *ProxyCall) SetGlobalIndex(index protocol.GlobalIndexType)

type ProxyCallManager

type ProxyCallManager struct {
	// contains filtered or unexported fields
}

ProxyCallManager manager proxy call for multi goroutine

func NewCallManager

func NewCallManager() *ProxyCallManager

func (*ProxyCallManager) Add

func (pcm *ProxyCallManager) Add(pc *ProxyCall) error

func (*ProxyCallManager) CreateProxyCall

func (pcm *ProxyCallManager) CreateProxyCall(proxyId ProxyUuid, timeOut uint32, retryTime int32, globalIndex protocol.GlobalIndexType) *ProxyCall

func (*ProxyCallManager) Destroy

func (pcm *ProxyCallManager) Destroy(callId uint32)

func (*ProxyCallManager) GenCallID

func (pcm *ProxyCallManager) GenCallID() uint32

func (*ProxyCallManager) Get

func (pcm *ProxyCallManager) Get(callId uint32) *ProxyCall

type ProxyUuid

type ProxyUuid uint32

Jump to

Keyboard shortcuts

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