cluster

package
v0.0.0-...-6b053b6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NeedWaitRequestTimes = 5
)

Variables

View Source
var (
	AgentChanRPC *chanrpc.Server
)
View Source
var (
	Processor = lgob.NewProcessor()
)

Functions

func AddClient

func AddClient(serverName, addr string)

func AsynCall

func AsynCall(serverName string, chanAsynRet chan *chanrpc.RetInfo, id interface{}, args ...interface{})

func Broadcast

func Broadcast(Prefix string, id interface{}, args ...interface{})

func Call0

func Call0(serverName string, id interface{}, args ...interface{}) error

func Call1

func Call1(serverName string, id interface{}, args ...interface{}) (interface{}, error)

func CallN

func CallN(serverName string, id interface{}, args ...interface{}) ([]interface{}, error)

func Destroy

func Destroy()

func GetRequestCount

func GetRequestCount() int

func Go

func Go(serverName string, id interface{}, args ...interface{})

func Init

func Init()

func RemoveClient

func RemoveClient(serverName string)

func SetRouter

func SetRouter(id interface{}, server *chanrpc.Server)

Types

type Agent

type Agent struct {
	ServerName string

	sync.Mutex
	// contains filtered or unexported fields
}

func GetAgent

func GetAgent(serverName string) *Agent

func (*Agent) AsynCall

func (a *Agent) AsynCall(chanAsynRet chan *chanrpc.RetInfo, id interface{}, args ...interface{})

func (*Agent) Call0

func (a *Agent) Call0(id interface{}, args ...interface{}) error

func (*Agent) Call1

func (a *Agent) Call1(id interface{}, args ...interface{}) (interface{}, error)

func (*Agent) CallN

func (a *Agent) CallN(id interface{}, args ...interface{}) ([]interface{}, error)

func (*Agent) Close

func (a *Agent) Close()

func (*Agent) Destroy

func (a *Agent) Destroy()

func (*Agent) GetRequestCount

func (a *Agent) GetRequestCount() int

func (*Agent) Go

func (a *Agent) Go(id interface{}, args ...interface{})

func (*Agent) LocalAddr

func (a *Agent) LocalAddr() net.Addr

func (*Agent) OnClose

func (a *Agent) OnClose()

func (*Agent) RemoteAddr

func (a *Agent) RemoteAddr() net.Addr

func (*Agent) Run

func (a *Agent) Run()

func (*Agent) SetUserData

func (a *Agent) SetUserData(data interface{})

func (*Agent) TimeOutCall1

func (a *Agent) TimeOutCall1(id interface{}, t time.Duration, args ...interface{}) (interface{}, error)

timeOutCall 会丢弃执行结果

func (*Agent) UserData

func (a *Agent) UserData() interface{}

func (*Agent) WriteMsg

func (a *Agent) WriteMsg(msg interface{})

type RequestInfo

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

type S2S_HeartBeat

type S2S_HeartBeat struct {
}

type S2S_NotifyServerName

type S2S_NotifyServerName struct {
	ServerName string
}

type S2S_RequestMsg

type S2S_RequestMsg struct {
	RequestID uint32
	MsgID     interface{}
	CallType  uint8
	Args      []interface{}
}

type S2S_ResponseMsg

type S2S_ResponseMsg struct {
	RequestID uint32
	Ret       interface{}
	Err       string
}

Jump to

Keyboard shortcuts

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