本文整理匯總了Python中cocaine.services.Service.find方法的典型用法代碼示例。如果您正苦於以下問題:Python Service.find方法的具體用法?Python Service.find怎麽用?Python Service.find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cocaine.services.Service
的用法示例。
在下文中一共展示了Service.find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: f
# 需要導入模塊: from cocaine.services import Service [as 別名]
# 或者: from cocaine.services.Service import find [as 別名]
def f():
io = IOLoop.current()
storage = Service("storage", endpoints=[["localhost", 10053]], io_loop=io)
channel = yield storage.find('app', ['apps'])
app_list = yield channel.rx.get()
assert isinstance(app_list, list)
raise gen.Return("OK")
示例2: test_service_with_seed
# 需要導入模塊: from cocaine.services import Service [as 別名]
# 或者: from cocaine.services.Service import find [as 別名]
def test_service_with_seed():
io = IOLoop.current()
n1 = Service("storage", seed="TEST_SEED")
channel = io.run_sync(lambda: n1.find('app', ['apps']))
app_list = io.run_sync(channel.rx.get)
assert isinstance(app_list, list)
示例3: main
# 需要導入模塊: from cocaine.services import Service [as 別名]
# 或者: from cocaine.services.Service import find [as 別名]
def main():
storage = Service("storage", endpoints=[["localhost", 10053]], io_loop=io)
channel = yield storage.find('app', ['apps'])
res = yield channel.rx.get()
raise gen.Return(res)