def start_master(config_path): """启动 master 模块 @param config_path : 配置文件路径 """ master = Master() master.config(config_path, 'src/start_server.py') master.start()
#coding:utf8 import os if os.name!='nt' and os.name!='posix': from twisted.internet import epollreactor epollreactor.install() if __name__=="__main__": from firefly.master.master import Master master = Master() master.config('config.json','appmain.py') master.start()
#coding:utf8 import os if os.name != 'nt': from twisted.internet import epollreactor epollreactor.install() if __name__ == "__main__": from firefly.master.master import Master master = Master() master.config('config.json', 'appmain.py') master.start()
# coding: utf8 """ 启动服务器 @name: startmaster.py @author: cbwfree @create: 15/12/29 20:02 """ import sys import os sys.path.append(os.path.abspath(os.path.dirname(__file__))) from firefly.master.master import Master, MULTI_SERVER_MODE from twisted.application import service import initialize APP_NAME = "firefly" APP_SCRIPT = "appmain.py" # 创建Application容器 application = service.Application(APP_NAME) # 创建守护进程 master = Master() master.set_script(APP_SCRIPT) # 设置启动脚本 master.set_mode(MULTI_SERVER_MODE) # 设置启动模式 master.start(application) # 启动守护进程