def on_open(self):
"""
Once the connection is made, start the query off and
start an event loop to wait for a signal to
stop. Results are yielded within receive().
"""
def event_loop():
logger.debug(pformat(self.query.request))
self.send(json.dumps(self.query.request))
while not self.event.is_set():
#print('Waiting around on the socket')
self.event.wait(self.gettimeout())
logger.debug('Event loop terminating.')
self.thread = threading.Thread(
target=event_loop)
self.thread.setDaemon(True)
self.thread.start()
评论列表
文章目录