Documentation ¶
Index ¶
- Constants
- func ActorInfo(sys *System) func(writer http.ResponseWriter, r *http.Request)
- func ClusterInfo(sys *System) func(writer http.ResponseWriter, r *http.Request)
- func LDebug(l *lua.LState) int
- func LError(l *lua.LState) int
- func LGoVersion(l *lua.LState) int
- func LWarn(l *lua.LState) int
- func New(id string, handler spawnActor, opt ...Option) *actor
- func ParseRequestId(requestId string) (sourceId string, targetId string, sourceAddr string, ok bool)
- type Actor
- type Base
- type EvClusterUpdate
- type EvDelActor
- type EvNewActor
- type EvSessionClosed
- type EvSessionOpened
- type Option
- type Profile
- type Sender
- type System
- func (s *System) Add(actor *actor) error
- func (s *System) Address() string
- func (ed *System) CancelAll(actorId string)
- func (ed *System) CancelEvent(actorId string, events ...interface{}) error
- func (s *System) Cluster() *actor
- func (ed *System) DispatchEvent(sourceId string, event interface{})
- func (s *System) LocalActor(actorId string) *actor
- func (s *System) ProfileAddr() string
- func (s *System) ProtoIndex() *tools.ProtoIndex
- func (ed *System) RegistEvent(actorId string, events ...interface{}) error
- func (s *System) RequestWait(targetId string, msg interface{}, timeout ...time.Duration) (resp interface{}, err error)
- func (s *System) Send(sourceId, targetId, requestId string, msg interface{}) (err error)
- func (s *System) SetCluster(act *actor)
- func (s *System) Spawn(id string, handler spawnActor, op ...Option) (Actor, error)
- func (s *System) Stop()
- type SystemOption
- type Timer
- type TmpActor
Constants ¶
View Source
const ( DefaultSysAddr = ":8888" DefaultProfileAddr = ":8760" )
View Source
const DefaultTimeout = time.Second * 10
Variables ¶
This section is empty.
Functions ¶
func ActorInfo ¶ added in v1.2.18
func ActorInfo(sys *System) func(writer http.ResponseWriter, r *http.Request)
func ClusterInfo ¶ added in v1.2.18
func ClusterInfo(sys *System) func(writer http.ResponseWriter, r *http.Request)
func LGoVersion ¶
Types ¶
type Base ¶
type Base struct {
Actor
}
func (*Base) OnHandleEvent ¶
func (s *Base) OnHandleEvent(event interface{})
func (*Base) OnHandleMessage ¶
func (*Base) OnHandleRequest ¶
type EvClusterUpdate ¶ added in v1.0.7
type EvDelActor ¶ added in v1.2.16
type EvNewActor ¶ added in v1.2.16
type EvSessionClosed ¶ added in v1.2.16
type EvSessionClosed struct {
PeerHost string
}
type EvSessionOpened ¶ added in v1.2.16
type EvSessionOpened struct {
PeerHost string
}
type Option ¶ added in v1.1.10
type Option func(*actor)
func SetLocalized ¶
func SetLocalized() Option
func SetMailBoxSize ¶
type Sender ¶ added in v1.1.1
type Sender interface { Send(targetId string, msg interface{}) error Request(targetId string, msg interface{}, timeout ...time.Duration) (req *request) RequestWait(targetId string, msg interface{}, timeout ...time.Duration) (result interface{}, err error) Response(requestId string, msg interface{}) error }
type System ¶
type System struct { CStop chan struct{} // contains filtered or unexported fields }
func NewSystem ¶
func NewSystem(op ...SystemOption) (*System, error)
func (*System) CancelEvent ¶
CancelEvent 取消actor事件
func (*System) DispatchEvent ¶
func (ed *System) DispatchEvent(sourceId string, event interface{})
DispatchEvent 事件触发
func (*System) LocalActor ¶ added in v1.2.19
func (*System) ProfileAddr ¶ added in v1.2.18
func (*System) ProtoIndex ¶ added in v1.2.2
func (s *System) ProtoIndex() *tools.ProtoIndex
func (*System) RegistEvent ¶
RegistEvent 注册actor事件
func (*System) RequestWait ¶ added in v1.2.18
func (s *System) RequestWait(targetId string, msg interface{}, timeout ...time.Duration) (resp interface{}, err error)
RequestWait sync request
func (*System) Send ¶
Send msg send to target,if target not exist in local cache msg shall send to cluster
func (*System) SetCluster ¶
func (s *System) SetCluster(act *actor)
type SystemOption ¶
func Addr ¶
func Addr(addr string) SystemOption
func ProfileAddr ¶ added in v1.2.18
func ProfileAddr(addr string) SystemOption
func ProtoIndex ¶ added in v1.2.0
func ProtoIndex(pi *tools.ProtoIndex) SystemOption
ProtoIndex index proto struct
type TmpActor ¶ added in v1.2.18
type TmpActor struct { Base Init func() HandleMessage func(sourceId, targetId string, msg interface{}) HandleRequest func(sourceId, targetId, requestId string, msg interface{}) error HandleEvent func(event interface{}) }
func (*TmpActor) OnHandleEvent ¶ added in v1.2.18
func (s *TmpActor) OnHandleEvent(event interface{})
func (*TmpActor) OnHandleMessage ¶ added in v1.2.18
func (*TmpActor) OnHandleRequest ¶ added in v1.2.18
Source Files ¶
Click to show internal directories.
Click to hide internal directories.