Documentation ¶
Index ¶
- Constants
- type Actor
- type Event
- type Group
- type Impl
- func (a *Impl) Actor() Actor
- func (a *Impl) AfterFunc(d time.Duration, repeat bool, fn func()) *timer.Timer
- func (a *Impl) EmitEvt(ctx context.Context, evt Event, data interface{})
- func (a *Impl) EnableParallel()
- func (a *Impl) Exec(ctx context.Context, fn func() (interface{}, error)) (interface{}, error)
- func (a *Impl) GetState() int32
- func (a *Impl) Init()
- func (a *Impl) OnClose(cb closeCallback)
- func (a *Impl) OnEvent(evt Event, cb evtCallback)
- func (a *Impl) OnTick(cb tickCallback)
- func (a *Impl) Push(ctx context.Context, fn func() (interface{}, error)) error
- func (a *Impl) Resume()
- func (a *Impl) SetName(name string)
- func (a *Impl) SetState(state int32)
- func (a *Impl) Start()
- func (a *Impl) Stop()
- func (a *Impl) Wait()
- type Job
- type JobRet
Constants ¶
View Source
const ( ASF_NULL = iota ASF_RUN = iota ASF_STOPPED = iota ASF_STOPPING = iota )
View Source
const ( MAIL_BOX_SIZE = 100 //报警阈值 INBOX_THRESHOLD = 30 TICK_INTERVAL = 500 * time.Millisecond EXEC_TIMEOUT = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor interface { Init() Start() Resume() Stop() Wait() Exec(context.Context, func() (interface{}, error)) (interface{}, error) Push(context.Context, func() (interface{}, error)) error GetState() int32 SetName(string) Actor() Actor OnClose(closeCallback) OnTick(tickCallback) OnEvent(Event, evtCallback) EmitEvt(context.Context, Event, interface{}) AfterFunc(time.Duration, bool, func()) *timer.Timer EnableParallel() //并发执行任务 }
type Group ¶
type Group interface { GetActor(Id uint64) Actor AddActor(Id uint64, ac Actor) DelActor(Id uint64) GetOwner() Actor Each(func(uint64, Actor)) Stop() Wait() Count() int }
func NewSafeGroup ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) EnableParallel ¶
func (a *Impl) EnableParallel()
Click to show internal directories.
Click to hide internal directories.