本文整理匯總了Python中cocaine.services.Service.notify_every方法的典型用法代碼示例。如果您正苦於以下問題:Python Service.notify_every方法的具體用法?Python Service.notify_every怎麽用?Python Service.notify_every使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cocaine.services.Service
的用法示例。
在下文中一共展示了Service.notify_every方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from cocaine.services import Service [as 別名]
# 或者: from cocaine.services.Service import notify_every [as 別名]
def main():
chrono = Service("chrono")
try:
chan = yield chrono.notify_after(0.1)
except:
print "1; error while connect to service"
exit(1)
try:
id = yield chan.rx.get()
try:
yield chan.rx.get()
except:
print "2; error while read notify on notify_after method"
exit(1)
except:
print "2; error while read id on notify_after method"
exit(1)
chan = yield chrono.notify_every(0.1)
try:
id = yield chan.rx.get()
try:
yield chan.rx.get()
except:
print "2; error while read notify on notify_every method"
exit(1)
except:
print "2; error while read id on notify_every method"
exit(1)
try:
yield chrono.restart(id)
except:
print "2; error while restart id on notify_every method"
exit(1)
try:
chan = yield chrono.cancel(id)
yield chan.rx.get()
except:
print "2; error while close id on notify_every method"
exit(1)
print "0;Ok"