当前位置: 首页>>代码示例>>Python>>正文


Python Controller.daemon方法代码示例

本文整理汇总了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()
开发者ID:liniii,项目名称:Real_time_sys_project,代码行数:19,代码来源:Main.py

示例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'
开发者ID:pumped,项目名称:dispm,代码行数:32,代码来源:main.py


注:本文中的Controller.Controller.daemon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。