async def handle_hook(self, hook: commands.StartHook) -> None: with self.timeout_watchdog.disarm(): # We currently only support single-argument hooks. data, = hook.args() await self.master.addons.handle_lifecycle(hook) if isinstance(data, flow.Flow): await data.wait_for_resume()
async def handle_hook(self, hook: commands.StartHook) -> None: with self.timeout_watchdog.disarm(): # We currently only support single-argument hooks. data, = hook.args() data.reply = AsyncReply(data) await self.master.addons.handle_lifecycle(hook) await data.reply.done.wait() data.reply = None
async def handle_hook(self, hook: commands.StartHook) -> None: data, = hook.args() data.reply = AsyncReply(data) await ctx.master.addons.handle_lifecycle(hook) await data.reply.done.wait() if isinstance(hook, (layers.http.HttpResponseHook, layers.http.HttpErrorHook)): if self.transports: # close server connections for x in self.transports.values(): if x.handler: x.handler.cancel() await asyncio.wait([x.handler for x in self.transports.values() if x.handler]) # signal completion self.done.set()
async def handle_hook( self, hook: commands.StartHook ) -> None: if hook.name in self.hook_handlers: self.hook_handlers[hook.name](*hook.args())