本文整理匯總了Python中zmq.asyncio.get_event_loop方法的典型用法代碼示例。如果您正苦於以下問題:Python asyncio.get_event_loop方法的具體用法?Python asyncio.get_event_loop怎麽用?Python asyncio.get_event_loop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zmq.asyncio
的用法示例。
在下文中一共展示了asyncio.get_event_loop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from zmq import asyncio [as 別名]
# 或者: from zmq.asyncio import get_event_loop [as 別名]
def __init__(self, context=None, loop=None):
super().__init__(context)
self.loop = loop or asyncio.get_event_loop()
self.__poller = None
self.__task = None
# TODO: Remove this commented method later
# @asyncio.coroutine
# def __handle_zap(self):
# while True:
# events = yield from self.__poller.poll()
# if self.zap_socket in dict(events):
# msg = yield from self.zap_socket.recv_multipart()
# self.handle_zap_message(msg)
示例2: __init__
# 需要導入模塊: from zmq import asyncio [as 別名]
# 或者: from zmq.asyncio import get_event_loop [as 別名]
def __init__(self, loop=None):
self.zmq_main_task = None
self.zmq_ctx = None
self.zmq_socket = None
self._port = 0
self._loop = loop or asyncio.get_event_loop()
self._module = None
self._executor = None