Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def init(self):
"""initialize the plugin."""
opt = dotdict(id=self.pid, secret=self.secret)
self.conn = PluginConnection(self, opt)
self.conn.setup()
self.terminated = False
initialized = self.loop.create_future()
self.on_plugin_message("initialized", initialized)
self.on_plugin_message("disconnected", self.terminate)
await initialized
workers = [
self.message_worker(self.janus_queue.async_q, self.conn.abort)
for i in range(2)
]
asyncio.ensure_future(asyncio.gather(*workers))
async def init(self):
"""initialize the plugin."""
opt = dotdict(id=self.pid, secret=self.secret)
self.conn = PluginConnection(opt, client=self)
self.terminated = False
initialized = self.loop.create_future()
self.on_plugin_message("initialized", initialized)
self.on_plugin_message("disconnected", self.terminate)
await initialized
workers = [
self.message_worker(self.janus_queue.async_q, self.conn.abort)
for i in range(2)
]
asyncio.ensure_future(asyncio.gather(*workers))
def __deepcopy__(self, memo=None):
"""Make a deep copy."""
return dotdict(copy.deepcopy(dict(self), memo=memo))
def __init__(self, engine, app, sio):
"""Set up connection instance attributes."""
self.engine = engine
self.app = app
self.sio = sio
self.store = dotdict()
self.reset_store()