sdk/python/lib/pulumi/runtime/rpc_manager.py
def do_rpc(self, name: str, rpc_function: Callable[..., Awaitable[Tuple[Any, Exception]]]) -> Callable[..., Awaitable[Tuple[Any, Exception]]]:
        """
        Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio
        event loop. The wrapped function catches all unhandled exceptions and reports them to the exception
        future, which consumers can await upon to listen for unhandled exceptions.

        The wrapped function also keeps track of the number of outstanding RPCs to synchronize during
        shutdown.
        :param name: The name of this RPC, to be used for logging
        :param rpc_function: The function implementing the RPC
        :return: An awaitable function implementing the RPC
        """
        async def rpc_wrapper(*args, **kwargs):
            log.debug(f"beginning rpc {name}")
            self.count += 1
            log.debug(f"recorded new RPC, {self.count} RPCs outstanding")

            try:
                result = await rpc_function(*args, **kwargs)
                exception = None
            except Exception as exn:
                log.debug(f"RPC failed with exception:")
                log.debug(traceback.format_exc())
                if self.unhandled_exception is None:
                    self.unhandled_exception = exn
                    self.exception_traceback = sys.exc_info()[2]
                result = None
                exception = exn

            self.count -= 1
            log.debug(f"recorded RPC completion, {self.count} RPCs outstanding")

            return result, exception

        return rpc_wrapper

        Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio
        event loop. The wrapped function catches all unhandled exceptions and reports them to the exception
        future, which consumers can await upon to listen for unhandled exceptions.

        The wrapped function also keeps track of the number of outstanding RPCs to synchronize during
        shutdown.
        :param name: The name of this RPC, to be used for logging
        :param rpc_function: The function implementing the RPC
        :return: An awaitable function implementing the RPC
        
Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio
event loop. The wrapped function catches all unhandled exceptions and reports them to the exception
future, which consumers can await upon to listen for unhandled exceptions.

The wrapped function also keeps track of the number of outstanding RPCs to synchronize during
shutdown.
Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio event loop . The wrapped function catches all unhandled exceptions and reports them to the exception future which consumers can await upon to listen for unhandled exceptions . The wrapped function also keeps track of the number of outstanding RPCs to synchronize during shutdown .
def do_rpc(self, name: str, rpc_function: Callable[..., Awaitable[Tuple[Any, Exception]]]) -> Callable[..., Awaitable[Tuple[Any, Exception]]]:
        async def rpc_wrapper(*args, **kwargs):
            log.debug(f"beginning rpc {name}")
            self.count += 1
            log.debug(f"recorded new RPC, {self.count} RPCs outstanding")
            try:
                result = await rpc_function(*args, **kwargs)
                exception = None
            except Exception as exn:
                log.debug(f"RPC failed with exception:")
                log.debug(traceback.format_exc())
                if self.unhandled_exception is None:
                    self.unhandled_exception = exn
                    self.exception_traceback = sys.exc_info()[2]
                result = None
                exception = exn
            self.count -= 1
            log.debug(f"recorded RPC completion, {self.count} RPCs outstanding")
            return result, exception
        return rpc_wrapper
def do_rpc ( self , name : str , rpc_function : Callable [ ... , Awaitable [ Tuple [ Any , Exception ] ] ] ) -> Callable [ ... , Awaitable [ Tuple [ Any , Exception ] ] ] : async def rpc_wrapper ( * args , ** kwargs ) : log . debug ( f"beginning rpc {name}" ) self . count += 1 log . debug ( f"recorded new RPC, {self.count} RPCs outstanding" ) try : result = await rpc_function ( * args , ** kwargs ) exception = None except Exception as exn : log . debug ( f"RPC failed with exception:" ) log . debug ( traceback . format_exc ( ) ) if self . unhandled_exception is None : self . unhandled_exception = exn self . exception_traceback = sys . exc_info ( ) [ 2 ] result = None exception = exn self . count -= 1 log . debug ( f"recorded RPC completion, {self.count} RPCs outstanding" ) return result , exception return rpc_wrapper
Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio
event loop.
Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio event loop .
"""
        Wraps a given RPC function by producing an awaitable function suitable to be run in the asyncio
        event loop. The wrapped function catches all unhandled exceptions and reports them to the exception
        future, which consumers can await upon to listen for unhandled exceptions.

        The wrapped function also keeps track of the number of outstanding RPCs to synchronize during
        shutdown.
        :param name: The name of this RPC, to be used for logging
        :param rpc_function: The function implementing the RPC
        :return: An awaitable function implementing the RPC
        """
An awaitable function implementing the RPC
An awaitable function implementing the RPC
self
name
str
The name of this RPC, to be used for logging
The name of this RPC to be used for logging
rpc_function
Callable[..., Awaitable[Tuple[Any, Exception]]]
The function implementing the RPC
The function implementing the RPC