(self)
Perform lazy tasks immediately

        When lightbus is used as a client it performs network tasks
        lazily. This speeds up import of your bus module, and prevents
        getting surprising errors at import time.

        However, in some cases you may wish to hurry up these lazy tasks
        (or perform them at a known point). In which case you can call this
        method to execute them immediately.
Perform lazy tasks immediately
Perform lazy tasks immediately
async def lazy_load_now(self):
        """Perform lazy tasks immediately

        When lightbus is used as a client it performs network tasks
        lazily. This speeds up import of your bus module, and prevents
        getting surprising errors at import time.

        However, in some cases you may wish to hurry up these lazy tasks
        (or perform them at a known point). In which case you can call this
        method to execute them immediately.
        """
        if self._lazy_load_complete:
            return

        # 1. Load the schema
        logger.debug("Loading schema...")
        await self.schema.ensure_loaded_from_bus()

        logger.info(
            LBullets(
                "Loaded the following remote schemas ({})".format(len(self.schema.remote_schemas)),
                items=self.schema.remote_schemas.keys(),
            )
        )

        # 2. Ensure the schema transport is loaded (other transports will be
        #    loaded as the need arises, but we need schema information from the get-go)
        await self.schema.ensure_loaded_from_bus()

        # 3. Add any local APIs to the schema
        for api in self.api_registry.all():
            await self.schema.add_api(api)

        logger.info(
            LBullets(
                "Loaded the following local schemas ({})".format(len(self.schema.remote_schemas)),
                items=self.schema.local_schemas.keys(),
            )
        )

        # 4. Done
        self._lazy_load_complete = True
async def lazy_load_now ( self ) : if self . _lazy_load_complete : return # 1. Load the schema logger . debug ( "Loading schema..." ) await self . schema . ensure_loaded_from_bus ( ) logger . info ( LBullets ( "Loaded the following remote schemas ({})" . format ( len ( self . schema . remote_schemas ) ) , items = self . schema . remote_schemas . keys ( ) , ) ) # 2. Ensure the schema transport is loaded (other transports will be #    loaded as the need arises, but we need schema information from the get-go) await self . schema . ensure_loaded_from_bus ( ) # 3. Add any local APIs to the schema for api in self . api_registry . all ( ) : await self . schema . add_api ( api ) logger . info ( LBullets ( "Loaded the following local schemas ({})" . format ( len ( self . schema . remote_schemas ) ) , items = self . schema . local_schemas . keys ( ) , ) ) # 4. Done self . _lazy_load_complete = True