Documentation ¶
Index ¶
- Constants
- func AssignActorId() int64
- type ACTOR_TYPE
- type Actor
- func (a *Actor) GetActorType() ACTOR_TYPE
- func (a *Actor) GetId() int64
- func (a *Actor) GetName() string
- func (a *Actor) GetRpcHead(ctx context.Context) rpc.RpcHead
- func (a *Actor) GetState() int32
- func (a *Actor) HasRpc(funcName string) bool
- func (a *Actor) Init()
- func (a *Actor) RegisterTimer(duration time.Duration, fun func(), opts ...timer.OpOption)
- func (a *Actor) Send(head rpc.RpcHead, packet rpc.Packet)
- func (a *Actor) SendMsg(head rpc.RpcHead, funcName string, params ...interface{})
- func (a *Actor) SetId(id int64)
- func (a *Actor) Start()
- func (a *Actor) Stop()
- func (a *Actor) Trace(funcName string)
- func (a *Actor) UpdateTimer(ctx context.Context, ptr uintptr)
- type ActorBase
- type ActorMgr
- func (a *ActorMgr) Init()
- func (a *ActorMgr) PacketFunc(packet rpc.Packet) bool
- func (a *ActorMgr) RegisterActor(ac IActor, params ...OpOption)
- func (a *ActorMgr) SendActor(funcName string, head rpc.RpcHead, packet rpc.Packet) bool
- func (a *ActorMgr) SendMsg(head rpc.RpcHead, funcName string, params ...interface{})
- func (a *ActorMgr) Start()
- type ActorPool
- type ActorPoolDynamic
- func (a *ActorPoolDynamic) AddActor(ac IActor)
- func (a *ActorPoolDynamic) DelActor(Id int64)
- func (a *ActorPoolDynamic) GetActor(Id int64) IActor
- func (a *ActorPoolDynamic) GetActorNum() int
- func (a *ActorPoolDynamic) GetMgr() IActor
- func (a *ActorPoolDynamic) InitActor(pPool IActorPool, rType reflect.Type)
- func (a *ActorPoolDynamic) SendActor(head rpc.RpcHead, packet rpc.Packet) bool
- type CallIO
- type IActor
- type IActorMgr
- type IActorPool
- type IActorPoolDynamic
- type ICluster
- type Op
- type OpOption
- type TraceInfo
Constants ¶
View Source
const ( ASF_NULL = iota ASF_RUN = iota ASF_STOP = iota )
View Source
const (
DESTROY_EVENT = iota
)
Variables ¶
This section is empty.
Functions ¶
func AssignActorId ¶
func AssignActorId() int64
Types ¶
type ACTOR_TYPE ¶
type ACTOR_TYPE uint32
const ( ACTOR_TYPE_SINGLETON ACTOR_TYPE = iota //单例 ACTOR_TYPE_VIRTUAL ACTOR_TYPE = iota //玩家 必须初始一个全局的actor 作为类型判断 ACTOR_TYPE_POOL ACTOR_TYPE = iota //固定数量actor池 ACTOR_TYPE_STUB ACTOR_TYPE = iota //stub )
type Actor ¶
type Actor struct { ActorBase // contains filtered or unexported fields }
func (*Actor) GetActorType ¶
func (a *Actor) GetActorType() ACTOR_TYPE
func (*Actor) RegisterTimer ¶
type ActorBase ¶
type ActorBase struct { Self IActor // contains filtered or unexported fields }
func (*ActorBase) IsActorType ¶
func (a *ActorBase) IsActorType(actorType ACTOR_TYPE) bool
type ActorMgr ¶
type ActorMgr struct {
// contains filtered or unexported fields
}
var (
MGR *ActorMgr
)
func (*ActorMgr) RegisterActor ¶
type ActorPool ¶
type ActorPool struct { MGR IActor // contains filtered or unexported fields }
******************************************************** actorpool管理,不能动态分配 ********************************************************
func (*ActorPool) GetPoolSize ¶
type ActorPoolDynamic ¶ added in v0.0.9
type ActorPoolDynamic struct { MGR IActor // contains filtered or unexported fields }
******************************************************** actorpooldynamic管理, 可以动态添加 ********************************************************
func (*ActorPoolDynamic) AddActor ¶ added in v0.0.9
func (a *ActorPoolDynamic) AddActor(ac IActor)
func (*ActorPoolDynamic) DelActor ¶ added in v0.0.9
func (a *ActorPoolDynamic) DelActor(Id int64)
func (*ActorPoolDynamic) GetActor ¶ added in v0.0.9
func (a *ActorPoolDynamic) GetActor(Id int64) IActor
func (*ActorPoolDynamic) GetActorNum ¶ added in v0.0.9
func (a *ActorPoolDynamic) GetActorNum() int
func (*ActorPoolDynamic) GetMgr ¶ added in v0.0.9
func (a *ActorPoolDynamic) GetMgr() IActor
func (*ActorPoolDynamic) InitActor ¶ added in v0.0.9
func (a *ActorPoolDynamic) InitActor(pPool IActorPool, rType reflect.Type)
type IActor ¶
type IActor interface { Init() Start() Stop() SendMsg(head rpc.RpcHead, funcName string, params ...interface{}) Send(head rpc.RpcHead, packet rpc.Packet) RegisterTimer(duration time.Duration, fun func(), opts ...timer.OpOption) GetId() int64 GetState() int32 GetRpcHead(ctx context.Context) rpc.RpcHead GetName() string GetActorType() ACTOR_TYPE HasRpc(string) bool // contains filtered or unexported methods }
type IActorPool ¶
******************************************************** actorpool管理,不能动态分配 ********************************************************
type IActorPoolDynamic ¶ added in v0.0.9
type IActorPoolDynamic interface { GetActor(Id int64) IActor AddActor(ac IActor) DelActor(Id int64) GetActorNum() int GetMgr() IActor }
******************************************************** actorpooldynamic管理, 可以动态添加 ********************************************************
type ICluster ¶
type ICluster interface {
BindPacketFunc(packetFunc network.PacketFunc)
}
type Op ¶
type Op struct {
// contains filtered or unexported fields
}
func (*Op) IsActorType ¶
func (op *Op) IsActorType(actorType ACTOR_TYPE) bool
Click to show internal directories.
Click to hide internal directories.