async def start_async(self): await self.connect_async() if self.app.logger.level > logging.INFO: print(get_boot_message()) else: self.app.logger.info(get_boot_message()) await asyncio.sleep(float("inf"))
def start(self): self.connect() if self.app.logger.level > logging.INFO: print(get_boot_message()) else: self.app.logger.info(get_boot_message()) Event().wait()
def start(self) -> None: """Starts a new web server process.""" if self.bolt_app.logger.level > logging.INFO: print(get_boot_message()) else: self.bolt_app.logger.info(get_boot_message()) web.run_app(self.web_app, host="0.0.0.0", port=self.port)
async def start_async(self): """Establishes a new connection and then starts infinite sleep to prevent the termination of this process. If you don't want to have the sleep, use `#connect()` method instead. """ await self.connect_async() if self.app.logger.level > logging.INFO: print(get_boot_message()) else: self.app.logger.info(get_boot_message()) await asyncio.sleep(float("inf"))
def start(self): self.connect() if self.app.logger.level > logging.INFO: print(get_boot_message()) else: self.app.logger.info(get_boot_message()) if sys.platform == "win32": # Ctrl+C etc does not work on Windows OS # see https://bugs.python.org/issue35935 for details signal.signal(signal.SIGINT, signal.SIG_DFL) Event().wait()
def start(self) -> None: """Starts a new web server process. :return: None """ if self._bolt_app.logger.level > logging.INFO: print(get_boot_message(development_server=True)) else: self._bolt_app.logger.info(get_boot_message(development_server=True)) try: self._server.serve_forever(0.05) finally: self._server.server_close()
def test_get_boot_message_win32(self): sys_platform_backup = sys.platform try: sys.platform = "win32" assert get_boot_message() == "Bolt app is running!" finally: sys.platform = sys_platform_backup
def start(self): """Establishes a new connection and then blocks the current thread to prevent the termination of this process. If you don't want to block the current thread, use `#connect()` method instead. """ self.connect() if self.app.logger.level > logging.INFO: print(get_boot_message()) else: self.app.logger.info(get_boot_message()) if sys.platform == "win32": # Ctrl+C etc does not work on Windows OS # see https://bugs.python.org/issue35935 for details signal.signal(signal.SIGINT, signal.SIG_DFL) Event().wait()
def test_get_boot_message(self): assert get_boot_message() == "⚡️ Bolt app is running!" assert (get_boot_message(development_server=True) == "⚡️ Bolt app is running! (development server)")