Documentation ¶
Index ¶
- Constants
- Variables
- func AddNodeRoute(mid uint32, nodeRoute *NodeRoute)
- func BindSID(agent *Agent)
- func BindUID(sid cfacade.SID, uid cfacade.UID) error
- func ClusterLocalDataRoute(agent *Agent, session *cproto.Session, msg *Message, nodeRoute *NodeRoute, ...) error
- func Count() int
- func DefaultDataRoute(agent *Agent, msg *Message, route *NodeRoute)
- func ForeachAgent(fn func(a *Agent))
- func LocalDataRoute(agent *Agent, session *cproto.Session, msg *Message, nodeRoute *NodeRoute, ...)
- func NewActor(agentActorID string) *actor
- func Response(iActor cfacade.IActor, session *cproto.Session, mid uint32, v interface{})
- func SetEndian(e binary.ByteOrder)
- func SetHeartbeatTime(t time.Duration)
- func SetWriteBacklog(backlog int)
- func Unbind(sid cfacade.SID)
- type ActorBase
- type Agent
- func (a *Agent) AddOnClose(fn OnCloseFunc)
- func (a *Agent) Bind(uid cfacade.UID) error
- func (a *Agent) Close()
- func (a *Agent) RemoteAddr() string
- func (a *Agent) Response(mid uint32, v interface{})
- func (a *Agent) Run()
- func (a *Agent) SID() cfacade.SID
- func (a *Agent) SendRaw(bytes []byte)
- func (a *Agent) Session() *cproto.Session
- func (a *Agent) SetLastAt()
- func (a *Agent) SetState(state int32) bool
- func (a *Agent) State() int32
- func (a *Agent) UID() cfacade.UID
- func (a *Agent) Unbind()
- type DataRouteFunc
- type Message
- type NodeRoute
- type OnCloseFunc
- type OnNewAgentFunc
Constants ¶
View Source
const ( AgentInit int32 = 0 AgentClosed int32 = 3 )
View Source
const (
ResponseFuncName = "response"
)
Variables ¶
View Source
var (
NoneMessage = Message{} // none message
)
Functions ¶
func AddNodeRoute ¶
func ClusterLocalDataRoute ¶
func DefaultDataRoute ¶
func ForeachAgent ¶
func ForeachAgent(fn func(a *Agent))
func LocalDataRoute ¶
func SetHeartbeatTime ¶
func SetWriteBacklog ¶
func SetWriteBacklog(backlog int)
Types ¶
type Agent ¶
type Agent struct { cfacade.IApplication // app // contains filtered or unexported fields }
func (*Agent) AddOnClose ¶
func (a *Agent) AddOnClose(fn OnCloseFunc)
func (*Agent) RemoteAddr ¶
type DataRouteFunc ¶
type NodeRoute ¶
func GetNodeRoute ¶
type OnCloseFunc ¶
type OnCloseFunc func(*Agent)
type OnNewAgentFunc ¶
type OnNewAgentFunc func(newAgent *Agent)
Click to show internal directories.
Click to hide internal directories.