define

package
v0.0.0-...-d62e3dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterActorTriggerTimerFunc

type AfterActorTriggerTimerFunc = func(err error, id satimer.ID, tag satimer.Tag, ctx sadefine.Context)

type BeforeActorTriggerTimerFunc

type BeforeActorTriggerTimerFunc = func(id satimer.ID, tag satimer.Tag, ctx sadefine.Context) (ok bool, err error)

type IWorker

type IWorker interface {
	PID() *sadefine.PID

	Start(ctx sadefine.Context, name string, startFunc func() error, wait bool) (err error)
	HasStart() bool
	Started() bool
	Stop(stopFunc func(), wait bool) error
	HasStop() bool

	Post(work sawork.IPostWork) error
	Dispatch(timeout time.Duration, work sawork.IDispatchWork) error

	NewTimer(dur time.Duration, tag satimer.Tag, cb satimer.Callback) satimer.ID
	NewLoopTimer(dur time.Duration, tag satimer.Tag, cb satimer.Callback) satimer.ID
	StopTimer(id satimer.ID) error
}

IWorker 供Super子类调用的接口

type IWorkerImplement

type IWorkerImplement interface {
	Destroy()

	OnStarted(ctx sadefine.Context)
	OnStopping(ctx sadefine.Context)
	OnStopped(ctx sadefine.Context)
	OnReceiveMessage(ctx sadefine.Context)
	OnActorTerminated(who *sadefine.PID, ctx sadefine.Context)
	OnRestarting(ctx sadefine.Context)
	OnRestarted(ctx sadefine.Context)

	BeforeTriggerTimer(id satimer.ID, tag satimer.Tag, ctx sadefine.Context) (ok bool, err error)
	AfterTriggerTimer(err error, id satimer.ID, tag satimer.Tag, ctx sadefine.Context)
}

IWorkerImplement 供Worker调用的接口

type OnActorReceiveMessageFunc

type OnActorReceiveMessageFunc = func(ctx sadefine.Context) (continued bool)

type OnActorRestartingFunc

type OnActorRestartingFunc = func(ctx sadefine.Context)

type OnActorStartedFunc

type OnActorStartedFunc = func(ctx sadefine.Context)

type OnActorStoppedFunc

type OnActorStoppedFunc = func(ctx sadefine.Context)

type OnActorStoppingFunc

type OnActorStoppingFunc = func(ctx sadefine.Context)

type OnActorTerminatedFunc

type OnActorTerminatedFunc = func(ctx sadefine.Context, who *sadefine.PID, why sadefine.TerminatedReason)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL