# HG changeset patch # User Goffi # Date 1696343053 -7200 # Node ID bb74f7dc3b100d54a2f38db0bf60ef40a1a71cae # Parent 6b581d4c249fae50258e24b4a5c2b2f0d91b86b2 frontend (quick app): allow to specify an async bridge: Async Bridge can now be specified and used with `a_bridge` in addition to the legacy one. The legacy one will eventually be removed. rel 424 diff -r 6b581d4c249f -r bb74f7dc3b10 libervia/frontends/quick_frontend/quick_app.py --- a/libervia/frontends/quick_frontend/quick_app.py Tue Oct 03 16:22:10 2023 +0200 +++ b/libervia/frontends/quick_frontend/quick_app.py Tue Oct 03 16:24:13 2023 +0200 @@ -246,7 +246,7 @@ return list(self._profiles.keys())[0] -class QuickApp(object): +class QuickApp: """This class contain the main methods needed for the frontend""" MB_HANDLER = True #: Set to False if the frontend doesn't manage microblog @@ -257,7 +257,10 @@ #: visible) AUTO_RESYNC = True - def __init__(self, bridge_factory, xmlui, check_options=None, connect_bridge=True): + def __init__( + self, bridge_factory, xmlui, check_options=None, connect_bridge=True, + async_bridge_factory=None + ): """Create a frontend application @param bridge_factory: method to use to create the bridge @@ -295,6 +298,11 @@ ## bridge ## self.bridge = bridge_factory() + if async_bridge_factory is None: + log.warning("No async bridge specified") + self.a_bridge = None + else: + self.a_bridge = async_bridge_factory() ProfileManager.bridge = self.bridge if connect_bridge: self.connect_bridge()