本文整理汇总了Python中Controller.Controller.daemon方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.daemon方法的具体用法?Python Controller.daemon怎么用?Python Controller.daemon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller.Controller
的用法示例。
在下文中一共展示了Controller.daemon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import daemon [as 别名]
def main():
#Create new threads
comedi = ComediCom()
mon = Monitor()
Gui_Thread = GUI(mon, comedi)
RefThread = ReferenceGenerator(mon)
ControlThread = Controller(mon, comedi)
# set daemon = True to connect all threads exit states such that when one exits, all does
ControlThread.daemon = True
RefThread.daemon = True
# Start new Threads
ControlThread.start()
Gui_Thread.start()
RefThread.start()
示例2: Controller
# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import daemon [as 别名]
from Controller import Controller
from server import *
from bottle import static_file, route, run
from logger import *
from WMS import WMS
import time
if __name__ == "__main__":
#threaded
try:
controller = Controller()
controller.daemon = True
controller.start()
wms = WMS()
wms.daemon = True
wms.start()
ws = webServer()
ws.runWebServer(controller, wms)
controller.onMessage(ws.emit)
#wait for termination
while threading.active_count() > 0:
time.sleep(0.1)
except (KeyboardInterrupt, SystemExit):
print 'Error: Cylons are killing users!'
print 'Waiting for Tasks to stop'