本文整理汇总了Python中transmitter.Transmitter.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Transmitter.stop方法的具体用法?Python Transmitter.stop怎么用?Python Transmitter.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transmitter.Transmitter
的用法示例。
在下文中一共展示了Transmitter.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Receiver
# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import stop [as 别名]
receiver = Receiver()
transmitter = Transmitter()
receiver.connect()
td1 = threading.Thread(target=handler.run)
td2 = threading.Thread(target=receiver.run)
td3 = threading.Thread(target=transmitter.run)
td1.start()
td2.start()
td3.start()
# main loop
while True:
if handler.is_runing() and receiver.is_runing() and transmitter.is_runing():
msg = receiver.fetch()
while msg != None:
handler.push(msg)
msg = receiver.fetch()
msg = handler.fetch_to_send()
while msg != None:
transmitter.push(msg)
msg = handler.fetch_to_send()
else:
break
handler.stop()
receiver.stop()
transmitter.stop()
td1.join()
td2.join()
td3.join()