本文整理匯總了Python中twitter.common.exceptions.ExceptionalThread.join方法的典型用法代碼示例。如果您正苦於以下問題:Python ExceptionalThread.join方法的具體用法?Python ExceptionalThread.join怎麽用?Python ExceptionalThread.join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twitter.common.exceptions.ExceptionalThread
的用法示例。
在下文中一共展示了ExceptionalThread.join方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from twitter.common.exceptions import ExceptionalThread [as 別名]
# 或者: from twitter.common.exceptions.ExceptionalThread import join [as 別名]
def main(args, opts):
"""Main"""
zkconn = kazoo_client.TwitterKazooClient(opts.zk)
zkconn.start()
server = RedirServer(zkconn, opts.zk_basepath, opts.scheduler_url,
opts.subdomain, opts.base_domain)
thread = ExceptionalThread(
target=lambda: server.run(opts.listen,
opts.port,
server='cherrypy'))
thread.daemon = True
thread.start()
# Wait forever, basically.
thread.join()
示例2: main
# 需要導入模塊: from twitter.common.exceptions import ExceptionalThread [as 別名]
# 或者: from twitter.common.exceptions.ExceptionalThread import join [as 別名]
def main(args, opts):
if args:
print("ERROR: unrecognized arguments: %s\n" % (" ".join(args)), file=sys.stderr)
app.help()
sys.exit(1)
root_server = HttpServer()
root_server.mount_routes(DiagnosticsEndpoints())
task_observer = TaskObserver(opts.root)
task_observer.start()
bottle_wrapper = BottleObserver(task_observer)
root_server.mount_routes(bottle_wrapper)
def run():
root_server.run('0.0.0.0', opts.port, 'cherrypy')
et = ExceptionalThread(target=run)
et.daemon = True
et.start()
et.join()