isra17 / autobahn-autoreconnect

Python Autobahn runner with auto-reconnect feature
GNU General Public License v2.0
19 stars 10 forks source link

Component Doesn't Get Created If Never Connected #22

Open webCoderLOL opened 6 years ago

webCoderLOL commented 6 years ago

Hi,

If the session is never established, the component won't be created. However, there are some functions that I need to run even not connected. However, if the connection drops intermittently, component is created, loop is still running, everything is cool. The question will be how can I instantiate the component even when the connection can't be established initially.

Thank you for the great module and help.

webCoderLOL commented 6 years ago
def _create_app_session():
    cfg = ComponentConfig(self._realm, self._extra)
    try:
        session = make(cfg)
    except Exception as e:
        # the app component could not be created .. fatal
        asyncio.get_event_loop().stop()
        raise e
    else:
        session.debug_app = self._debug_app
        return session

Doesn't make(cfg) always get called?