Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
job = await async_q.get()
async_q.task_done()
if job is None:
continue
if "setInterface" == job["type"]:
api = self.conn.set_remote(job["api"])
self.conn.local["np"] = np
self.conn.emit({"type": "interfaceSetAsRemote"})
if not self.conn.init:
self.conn.set_interface(self.imjoy_api)
self.conn.init = True
async_q.task_done()
else:
handler = JOB_HANDLERS_PY3.get(job["type"])
if handler is None:
continue
try:
await handler(self.conn, job, logger)
except Exception: # pylint: disable=broad-except
logger.error(
"Error occured in the loop %s", traceback.format_exc()
)
finally:
sys.stdout.flush()
except Exception as e:
print(e)
job = await async_q.get()
async_q.task_done()
if job is None:
continue
if "setInterface" == job["type"]:
api = self.conn.set_remote(job["api"])
self.conn.local["np"] = np
self.conn.emit({"type": "interfaceSetAsRemote"})
if not self.conn.init:
self.conn.set_interface(self.imjoy_api)
self.conn.init = True
async_q.task_done()
else:
handler = JOB_HANDLERS_PY3.get(job["type"])
if handler is None:
continue
try:
await handler(self.conn, job, logger)
except Exception: # pylint: disable=broad-except
logger.error(
"Error occured in the loop %s", traceback.format_exc()
)
finally:
sys.stdout.flush()
except Exception as e:
print(e)