rpc_client

package
Version: v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPC_REQUEST_TIMEOUT = 30 * time.Second
)

Variables

View Source
var (
	MAX_CHECK_ALIVE_RETRY = 600

	CHECK_ALIVE_INTERNAL = 100
)

Functions

This section is empty.

Types

type ClientMessageSender

type ClientMessageSender interface {

	// Send msg with response object.
	SendMsgWithResponse(msg interface{}) (interface{}, error)

	// Send msg with response object.
	SendMsgWithResponseAndTimeout(msg interface{}, timeout time.Duration) (interface{}, error)

	// Send response.
	SendResponse(request protocal.RpcMessage, serverAddress string, msg interface{})
}

type GettyClientSessionManager

type GettyClientSessionManager struct{}

func (*GettyClientSessionManager) AcquireGettySession

func (sessionManager *GettyClientSessionManager) AcquireGettySession() getty.Session

func (*GettyClientSessionManager) AcquireGettySessionByServerAddress

func (sessionManager *GettyClientSessionManager) AcquireGettySessionByServerAddress(serverAddress string) getty.Session

func (*GettyClientSessionManager) RegisterGettySession

func (sessionManager *GettyClientSessionManager) RegisterGettySession(session getty.Session)

func (*GettyClientSessionManager) ReleaseGettySession

func (sessionManager *GettyClientSessionManager) ReleaseGettySession(session getty.Session)

type RpcRMMessage

type RpcRMMessage struct {
	RpcMessage    protocal.RpcMessage
	ServerAddress string
}

type RpcRemoteClient

type RpcRemoteClient struct {
	BranchCommitRequestChannel   chan RpcRMMessage
	BranchRollbackRequestChannel chan RpcRMMessage
	GettySessionOnOpenChannel    chan string
	// contains filtered or unexported fields
}

func GetRpcRemoteClient

func GetRpcRemoteClient() *RpcRemoteClient

func InitRpcRemoteClient

func InitRpcRemoteClient() *RpcRemoteClient

func (*RpcRemoteClient) OnClose

func (client *RpcRemoteClient) OnClose(session getty.Session)

OnClose ...

func (*RpcRemoteClient) OnCron

func (client *RpcRemoteClient) OnCron(session getty.Session)

OnCron ...

func (*RpcRemoteClient) OnError

func (client *RpcRemoteClient) OnError(session getty.Session, err error)

OnError ...

func (*RpcRemoteClient) OnMessage

func (client *RpcRemoteClient) OnMessage(session getty.Session, pkg interface{})

OnMessage ...

func (*RpcRemoteClient) OnOpen

func (client *RpcRemoteClient) OnOpen(session getty.Session) error

OnOpen ...

func (*RpcRemoteClient) RegisterResource

func (client *RpcRemoteClient) RegisterResource(serverAddress string, request protocal.RegisterRMRequest)

func (*RpcRemoteClient) SendMsgWithResponse

func (client *RpcRemoteClient) SendMsgWithResponse(msg interface{}) (interface{}, error)

************************************* ClientMessageSender *************************************

func (*RpcRemoteClient) SendMsgWithResponseAndTimeout

func (client *RpcRemoteClient) SendMsgWithResponseAndTimeout(msg interface{}, timeout time.Duration) (interface{}, error)

func (*RpcRemoteClient) SendResponse

func (client *RpcRemoteClient) SendResponse(request protocal.RpcMessage, serverAddress string, msg interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to