Documentation ¶
Index ¶
- type Executor
- func (that *Executor) AddApp(a kapp.IApp) error
- func (that *Executor) Clone() (process.IProc, error)
- func (that *Executor) GetAppNeedToStart() []string
- func (that *Executor) GracefulReload(wait bool) (bool, error)
- func (that *Executor) MakeApp(a kapp.IApp) (kapp.IApp, error)
- func (that *Executor) NewChildProcForStart(configFilePath string)
- func (that *Executor) RemoveApp(name string)
- func (that *Executor) StartAllApps()
- func (that *Executor) StartApp(name string) error
- func (that *Executor) StopApp(name string) error
- func (that *Executor) StopExecutor()
- type IKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct { *process.ProcessPlus // Executor 对应的进程 Pid int // 在主进程中,缓存Executor对应的子进程的Pid Keeper IKeeper // Executor所属的管理者 Name string // 执行器名称 AppList *gmap.StrAnyMap // 保存的App列表,key: appName, value: appContainer AppsRunning *gmap.StrAnyMap // 当前正在运行中的App }
Executor 用于保存和运行App;一个Executor可以保存多个App。 在多进程模式下,一个Executor会开启一个新的进程来运行其下的所有App,一个App在新进程中对应一个goroutine。 在单进程模式下,EXecutor只会开启新的goroute来运行行App,所有的goroutine都在一个进程中。
func (*Executor) GetAppNeedToStart ¶
GetAppCanStart 获取本Executor中需要在子进程中启动的AppNames
func (*Executor) GracefulReload ¶
GracefulReload 平滑重启Executor
func (*Executor) NewChildProcForStart ¶
CreateNewProcess 启动新的子进程来执行start命令; 本方法只在主进程中执行; 一个子进程对应于一个Executor。
func (*Executor) StartAllApps ¶
func (that *Executor) StartAllApps()
StartApps 启动Executor中需要启动的App; 多进程模式下,本方法在子进程中执行; 单进程模式下,本方法在主进程中执行(因为只有一个进程);
func (*Executor) StopExecutor ¶
func (that *Executor) StopExecutor()
TODO:
StopExecutor 停止执行当前Executor; 会关闭所有正在运行的App。
type IKeeper ¶
type IKeeper interface { Config() *gcfg.Config IsMaster() bool ListOfAppsToStart() *garray.StrArray Mode() ktype.ProcMode NewProcess(name string, opts ...process.Option) (*process.ProcessPlus, error) ProcManager() *process.Manager GetExecutorsRunning() *gmap.StrAnyMap }
Keeper实现本接口的方法在ki_executor.go中
Click to show internal directories.
Click to hide internal directories.