Documentation ¶
Index ¶
- Constants
- type Actor
- type Base
- type BaseFunc
- type Drainer
- type Handler
- type Id
- type Message
- type Messenger
- type Option
- type RequestId
- type System
- func (s *System) Address() string
- func (ed *System) CancelAll(actorId Id)
- func (ed *System) CancelEvent(actorId Id, events ...interface{})
- func (s *System) Cluster() Id
- func (ed *System) DispatchEvent(sourceId Id, event interface{})
- func (s *System) HasActor(actorId string) bool
- func (s *System) NewActor(id Id, handler spawnActor, opt ...Option) error
- func (ed *System) OnEvent(actorId Id, callback Handler)
- func (s *System) ProtoIndex() *tools.ProtoIndex
- func (s *System) Send(sourceId, targetId Id, requestId RequestId, msg any) (err error)
- func (s *System) SetCluster(id Id)
- func (s *System) Stop()
- func (s *System) WaiterId() string
- type SystemOption
- type Timer
Constants ¶
View Source
const (
DefaultSysAddr = ":8888"
)
View Source
const DefaultTimeout = time.Second * 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v1.1.10
type Option func(*actor)
Option the extra options of the new actor
func SetLocalized ¶
func SetLocalized() Option
SetLocalized indicates that it can't be discovered by other System, meaning, this actor is localized.
func SetMailBoxSize ¶
type System ¶
type System struct { Stopped chan struct{} // contains filtered or unexported fields }
func NewSystem ¶
func NewSystem(op ...SystemOption) (*System, error)
func (*System) CancelEvent ¶
func (ed *System) CancelEvent(actorId Id, events ...interface{})
func (*System) DispatchEvent ¶
func (ed *System) DispatchEvent(sourceId Id, event interface{})
func (*System) NewActor ¶ added in v1.4.0
NewActor new an actor for system id is invalid if contain '@' or '$'
func (*System) ProtoIndex ¶ added in v1.2.2
func (s *System) ProtoIndex() *tools.ProtoIndex
func (*System) SetCluster ¶
type SystemOption ¶
func Addr ¶
func Addr(addr string) SystemOption
func LogLevel ¶ added in v1.3.6
func LogLevel(level logger.Level) SystemOption
func Name ¶ added in v1.3.9
func Name(name string) SystemOption
func Output ¶ added in v1.3.6
func Output(out io.Writer) SystemOption
func ProtoIndex ¶ added in v1.2.0
func ProtoIndex(pi *tools.ProtoIndex) SystemOption
ProtoIndex index proto struct
Source Files ¶
Click to show internal directories.
Click to hide internal directories.