Documentation ¶
Index ¶
- Variables
- func AllocRPCSeq() int64
- func DestroyDomain(name string)
- func Exit(exitcode int)
- func Load(pid *PID, data []byte)
- func LoopSystem() int
- func Save(pid *PID) []byte
- func StartSystem()
- func VisitDomains(callback func(*Domain) bool)
- type Actor
- type ActorCreator
- type ActorTemplate
- func (self *ActorTemplate) WithCreator(ac ActorCreator) *ActorTemplate
- func (self *ActorTemplate) WithFunc(f func(c Context)) *ActorTemplate
- func (self *ActorTemplate) WithID(id string) *ActorTemplate
- func (self *ActorTemplate) WithInstance(a Actor) *ActorTemplate
- func (self *ActorTemplate) WithParent(pid *PID) *ActorTemplate
- type Context
- type Domain
- type LocalProcess
- func (self *LocalProcess) CreateRPC(waitCallID int64) *util.Future
- func (self *LocalProcess) Init(a Actor, pid *PID, dm *Domain) *LocalProcess
- func (self *LocalProcess) OnRecv(data interface{})
- func (self *LocalProcess) PID() *PID
- func (self *LocalProcess) Serialize(ser Serializer)
- func (self *LocalProcess) Stop()
- func (self *LocalProcess) Tell(data interface{})
- type Message
- type PID
- func (self *PID) Call(data interface{}, sender *PID) interface{}
- func (self *PID) CallFuture(data interface{}, sender *PID) *util.Future
- func (self *PID) FromProto(pid proto.PID)
- func (self *PID) String() string
- func (self *PID) Tell(data interface{})
- func (self *PID) TellBySender(data interface{}, sender *PID)
- func (self *PID) ToProto() proto.PID
- type Process
- type Relation
- type RelationImplement
- type Serializable
- type Serializer
Constants ¶
This section is empty.
Variables ¶
View Source
var EnableDebug bool
View Source
var (
OnReset util.Delegate
)
View Source
var RemoteProcessCreator func(*PID, *Domain) Process
Functions ¶
func AllocRPCSeq ¶
func AllocRPCSeq() int64
func DestroyDomain ¶
func DestroyDomain(name string)
func LoopSystem ¶
func LoopSystem() int
func StartSystem ¶
func StartSystem()
func VisitDomains ¶
Types ¶
type ActorCreator ¶
type ActorCreator func() Actor
type ActorTemplate ¶
type ActorTemplate struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func NewTemplate() *ActorTemplate
func (*ActorTemplate) WithCreator ¶
func (self *ActorTemplate) WithCreator(ac ActorCreator) *ActorTemplate
func (*ActorTemplate) WithFunc ¶
func (self *ActorTemplate) WithFunc(f func(c Context)) *ActorTemplate
func (*ActorTemplate) WithID ¶
func (self *ActorTemplate) WithID(id string) *ActorTemplate
func (*ActorTemplate) WithInstance ¶
func (self *ActorTemplate) WithInstance(a Actor) *ActorTemplate
func (*ActorTemplate) WithParent ¶
func (self *ActorTemplate) WithParent(pid *PID) *ActorTemplate
type Context ¶
type Context interface { // 消息本体 Msg() interface{} // 消息来源方,可能为空 Source() *PID // Actor本体的PID Self() *PID Parent() *PID // 当对方用Call调用时, 需要用Reply回应 Reply(data interface{}) String() string }
信息上下文
type Domain ¶
type Domain struct { Name string RemoteContext interface{} // contains filtered or unexported fields }
func CreateDomain ¶
func CreateRemoteDomain ¶
func MustGetDomain ¶
func (*Domain) Spawn ¶
func (self *Domain) Spawn(t *ActorTemplate) *PID
type LocalProcess ¶
type LocalProcess struct { *RelationImplement // contains filtered or unexported fields }
func (*LocalProcess) Init ¶
func (self *LocalProcess) Init(a Actor, pid *PID, dm *Domain) *LocalProcess
func (*LocalProcess) OnRecv ¶
func (self *LocalProcess) OnRecv(data interface{})
func (*LocalProcess) PID ¶
func (self *LocalProcess) PID() *PID
func (*LocalProcess) Serialize ¶
func (self *LocalProcess) Serialize(ser Serializer)
func (*LocalProcess) Stop ¶
func (self *LocalProcess) Stop()
func (*LocalProcess) Tell ¶
func (self *LocalProcess) Tell(data interface{})
type PID ¶
func (*PID) TellBySender ¶
type RelationImplement ¶
type RelationImplement struct {
// contains filtered or unexported fields
}
func NewRelation ¶
func NewRelation(proc Process, dm *Domain) *RelationImplement
func (*RelationImplement) AddChild ¶
func (self *RelationImplement) AddChild(pid *PID)
func (*RelationImplement) Domain ¶
func (self *RelationImplement) Domain() *Domain
func (*RelationImplement) ParentPID ¶
func (self *RelationImplement) ParentPID() *PID
func (*RelationImplement) SetParentPID ¶
func (self *RelationImplement) SetParentPID(ppid *PID)
type Serializable ¶
type Serializable interface {
OnSerialize(Serializer)
}
type Serializer ¶
func NewBinaryReader ¶
func NewBinaryReader(r io.Reader) Serializer
func NewBinaryWriter ¶
func NewBinaryWriter() Serializer
Click to show internal directories.
Click to hide internal directories.