Documentation ¶
Index ¶
- Constants
- type Agent
- func (a *Agent) Close()
- func (a *Agent) Kick(reason interface{}) error
- func (a *Agent) Push(route string, val interface{}) error
- func (a *Agent) RPC(route string, val interface{}) error
- func (a *Agent) RemoteAddr() net.Addr
- func (a *Agent) Response(mid uint, v interface{}, isError ...bool) error
- func (a *Agent) Run()
- func (a *Agent) Send(typ cherryMessage.Type, route string, mid uint, v interface{}, isError bool) (err error)
- func (a *Agent) SendRaw(bytes []byte) error
- func (a *Agent) SetLastAt()
- type AgentBackend
- func (a *AgentBackend) Close()
- func (a *AgentBackend) Kick(reason interface{}) error
- func (a *AgentBackend) Push(route string, val interface{}) error
- func (a *AgentBackend) RPC(route string, val interface{}) error
- func (a *AgentBackend) RemoteAddr() net.Addr
- func (a *AgentBackend) Response(mid uint, val interface{}, isError ...bool) error
- func (a *AgentBackend) SendRaw(_ []byte) error
- type Options
- type RPCHandler
Constants ¶
View Source
const (
WriteBacklog = 64
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { sync.RWMutex *Options cherryFacade.IApplication Session *cherrySession.Session // session // contains filtered or unexported fields }
func (*Agent) Close ¶
func (a *Agent) Close()
Close closes the Agent, clean inner state and close low-level connection.
func (*Agent) RemoteAddr ¶
RemoteAddr implementation for session.NetworkEntity interface returns the remote network address.
type AgentBackend ¶ added in v1.1.9
type AgentBackend struct { cherryFacade.IApplication ClusterComponent *cherryCluster.Component Sid cherryFacade.SID Session *cherrySession.Session FrontendId cherryFacade.FrontendId }
func (*AgentBackend) Close ¶ added in v1.1.9
func (a *AgentBackend) Close()
func (*AgentBackend) Kick ¶ added in v1.1.9
func (a *AgentBackend) Kick(reason interface{}) error
func (*AgentBackend) Push ¶ added in v1.1.9
func (a *AgentBackend) Push(route string, val interface{}) error
func (*AgentBackend) RPC ¶ added in v1.1.9
func (a *AgentBackend) RPC(route string, val interface{}) error
func (*AgentBackend) RemoteAddr ¶ added in v1.1.9
func (a *AgentBackend) RemoteAddr() net.Addr
func (*AgentBackend) Response ¶ added in v1.1.9
func (a *AgentBackend) Response(mid uint, val interface{}, isError ...bool) error
func (*AgentBackend) SendRaw ¶ added in v1.1.9
func (a *AgentBackend) SendRaw(_ []byte) error
type Options ¶
type Options struct { Heartbeat time.Duration // heartbeat(sec) Commands map[cherryPacket.Type]cherryCommand.ICommand // commands RPCHandler RPCHandler // rpc handler }
type RPCHandler ¶
type RPCHandler func(session *cherrySession.Session, route string, val interface{})
Click to show internal directories.
Click to hide internal directories.