Closed lailongwei closed 1 year ago
Service运行流程:
class LLBC_ServiceRunningPhase
{
public:
enum ENUM
{
Begin = 0,
// Service has not been started.
NotStarted = Begin,
// Service pre-starting(Perform some preparatory work before initializing components).
PreStarting,
// Specific service pre-start failed.
PreStartFailed,
// Service has been pre-started.
PreStarted,
// Service is currently initializing components.
InitingComps,
// Specific service initialize components failed.
InitCompsFailed,
// Service has been initialized all components.
CompsInited,
// Service is currently starting components.
StartingComps,
// Specific service start components failed.
StartCompsFailed,
// Service has been started all components.
CompsStarted,
// Service has been started.
Started,
// Service is currently stopping components.
StoppingComps,
// Service is currently stopping.
Stopping,
End,
};
};
已完整完整,Service流程标准化的同时,整体代码也得到的简化
完整简化、梳理Service,集中于以下几个方面:
volatile
的地方Start
/Stop
事件