本文整理匯總了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()