Documentation
¶
Index ¶
- Constants
- Variables
- func WaitForShutdown(sm WorkerI) bool
- func WaitForShutdownAll(sms []WorkerI) (ok bool)
- func WaitForShutdownAllTimeout(sms []WorkerI, dur time.Duration) (ok bool)
- func WaitForShutdownTimeout(sm WorkerI, dur time.Duration) bool
- func WaitForStartup(sm WorkerI) bool
- func WaitForStartupAll(sms []WorkerI) (ok bool)
- func WaitForStartupAllTimeout(sms []WorkerI, dur time.Duration) (ok bool)
- func WaitForStartupTimeout(sm WorkerI, dur time.Duration) bool
- type Message
- type Monitor
- func (this *Monitor) Init(monitor MonitorI)
- func (this *Monitor) Run()
- func (this *Monitor) SendMsg(t int)
- func (this *Monitor) SendMsg2(t int, from interface{})
- func (this *Monitor) SendMsg3(t int, from, data interface{})
- func (this *Monitor) Shutdown()
- func (this *Monitor) Startup()
- func (this *Monitor) State() int
- type MonitorI
- type Worker
- func (this *Worker) Init(worker WorkerI)
- func (this *Worker) Run()
- func (this *Worker) SendMsg(t int)
- func (this *Worker) SendMsg2(t int, from interface{})
- func (this *Worker) SendMsg3(t int, from, data interface{})
- func (this *Worker) Shutdown()
- func (this *Worker) Startup()
- func (this *Worker) State() int
- type WorkerI
Constants ¶
View Source
const ( STA_INITIALING = iota // New开始执行时的默认状态,到PreLoop完成之前 STA_RUNNING // 具体执行任务的状态 STA_PAUSING // 暂停状态 STA_STOPPING // 正在停止的状态。从循环结束开始,到AfterLoop完成 STA_FAILED // 处于失败的状态。 STA_STOPPED // 线程已经停止。 )
View Source
const (
CMD_SHUTDOWN = iota
)
Variables ¶
View Source
var ERR_STARTUP_FAILED = errors.New("Startup failed")
View Source
var MESSAGE_TYPES []string = []string{"CMD_SHUTDOWN"}
View Source
var STATES []string = []string{
"STA_INITIALING",
"STA_RUNNING",
"STA_PAUSING",
"STA_STOPPING",
"STA_FAILED",
"STA_STOPPED"}
Functions ¶
func WaitForShutdown ¶
func WaitForShutdownAll ¶
func WaitForStartup ¶
func WaitForStartupAll ¶
Types ¶
type Message ¶
type Message struct {
Type int
From interface{}
Data interface{}
}
func MessageNew ¶
func MessageNew2 ¶
func MessageNew3 ¶
Click to show internal directories.
Click to hide internal directories.