Documentation ¶
Index ¶
- func Create(impl sdefine.IWorkerImplement, optionFuncs ...OptionFunc) sdefine.IWorker
- type OptionFunc
- type Super
- func (s *Super) AfterTriggerTimer(err error, id satimer.ID, tag satimer.Tag, ctx sadefine.Context)
- func (s *Super) BeforeTriggerTimer(id satimer.ID, tag satimer.Tag, ctx sadefine.Context) (ok bool, err error)
- func (s *Super) Create(impl sdefine.IWorkerImplement, optionFuncs ...OptionFunc)
- func (s *Super) Destroy()
- func (s *Super) OnActorTerminated(who *sadefine.PID, ctx sadefine.Context)
- func (s *Super) OnReceiveMessage(ctx sadefine.Context)
- func (s *Super) OnRestarted(ctx sadefine.Context)
- func (s *Super) OnRestarting(ctx sadefine.Context)
- func (s *Super) OnStarted(ctx sadefine.Context)
- func (s *Super) OnStopped(ctx sadefine.Context)
- func (s *Super) OnStopping(ctx sadefine.Context)
- type Worker
- func (w *Worker) Dispatch(timeout time.Duration, work sawork.IDispatchWork) error
- func (w *Worker) HasStart() bool
- func (w *Worker) HasStop() bool
- func (w *Worker) NewLoopTimer(dur time.Duration, tag satimer.ID, cb satimer.Callback) satimer.ID
- func (w *Worker) NewTimer(dur time.Duration, tag satimer.Tag, cb satimer.Callback) satimer.ID
- func (w *Worker) PID() *sadefine.PID
- func (w *Worker) ParentPID() *sadefine.PID
- func (w *Worker) Post(work sawork.IPostWork) error
- func (w *Worker) Receive(ctx sadefine.Context)
- func (w *Worker) SetSign(sign string)
- func (w *Worker) Sign() string
- func (w *Worker) Start(ctx sadefine.Context, name string, startFunc func() error, wait bool) (err error)
- func (w *Worker) Started() bool
- func (w *Worker) Stop(stopFunc func(), wait bool) error
- func (w *Worker) StopTimer(id satimer.ID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(impl sdefine.IWorkerImplement, optionFuncs ...OptionFunc) sdefine.IWorker
Types ¶
type OptionFunc ¶
type OptionFunc func(option *option)
func WithDecider ¶
func WithDecider(decider sadefine.DeciderFunc) OptionFunc
func WithMailBoxSize ¶
func WithMailBoxSize(mailBoxSize int) OptionFunc
func WithStartedWaitGroup ¶
func WithStartedWaitGroup(startedWg *sync.WaitGroup) OptionFunc
func WithStoppedWaitGroup ¶
func WithStoppedWaitGroup(stoppedWg *sync.WaitGroup) OptionFunc
type Super ¶
func (*Super) AfterTriggerTimer ¶
func (*Super) BeforeTriggerTimer ¶
func (*Super) Create ¶
func (s *Super) Create(impl sdefine.IWorkerImplement, optionFuncs ...OptionFunc)
func (*Super) OnActorTerminated ¶
func (*Super) OnReceiveMessage ¶
func (*Super) OnRestarted ¶
func (*Super) OnRestarting ¶
func (*Super) OnStopping ¶
Click to show internal directories.
Click to hide internal directories.