Documentation ¶
Index ¶
- Constants
- Variables
- func AddClient(c *NsqClient)
- func AsynCall(serverName string, chanAsynRet chan *chanrpc.RetInfo, id string, ...)
- func Broadcast(serverName string, id string, args ...interface{})
- func Call0(serverName string, id string, args ...interface{}) error
- func Call1(serverName string, id string, args ...interface{}) (interface{}, error)
- func ForEachRequest(f func(id int64, request *RequestInfo))
- func GetGameServerName(id int) string
- func GetHallServerName(id int) string
- func Go(serverName string, id string, args ...interface{})
- func HasClient(name string) bool
- func NewNsqHandler() *nsqHandler
- func Publish(msg *S2S_NsqMsg) error
- func RemoveClient(serverName string)
- func SetRouter(msgID string, server *chanrpc.Server)
- func Start(cfg *Cluster_config)
- func Stop()
- func TimeOutCall1(serverName string, t time.Duration, id string, args ...interface{}) (interface{}, error)
- type Cluster_config
- type NsqClient
- type RequestInfo
- type S2S_NsqMsg
Constants ¶
View Source
const ( NsqMsgTypeRsp = iota //回应消息 NsqMsgTypeBroadcast //广播消息 NsqMsgTypeNotForResult // 不用回请求的消息 NsqMsgTypeForResult //要回请求的消息 )
Variables ¶
View Source
var ( Processor = lgob.NewProcessor() RequestInfoLock sync.Mutex )
View Source
var (
SelfName string
)
Functions ¶
func ForEachRequest ¶
func ForEachRequest(f func(id int64, request *RequestInfo))
func GetGameServerName ¶
func GetHallServerName ¶
func NewNsqHandler ¶
func NewNsqHandler() *nsqHandler
func Publish ¶
func Publish(msg *S2S_NsqMsg) error
func RemoveClient ¶
func RemoveClient(serverName string)
func Start ¶
func Start(cfg *Cluster_config)
Types ¶
type Cluster_config ¶
type Cluster_config struct { LogLv string Channel string //唯一标识 Csmtopics []string //需要订阅的主题 CsmUserAgent string //消费者的UserAgent CsmNsqdAddrs []string CsmNsqLookupdAddrs []string CsmMaxInFlight int PdrNsqdAddr string //生产者需要连接的nsqd地址 PdrUserAgent string //生产者的UserAgent PdrMaxInFlight int SelfName string }
type RequestInfo ¶
type RequestInfo struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.