python/ray/serve/replica.py
async def invoke_single(self, request_item: Query) -> Tuple[Any, bool]:
        """Executes the provided request on this replica.

        Returns the user-provided output and a boolean indicating if the
        request succeeded (user code didn't raise an exception).
        """
        logger.debug(
            "Replica {} started executing request {}".format(
                self.replica_tag, request_item.metadata.request_id
            )
        )
        args, kwargs = parse_request_item(request_item)

        method_to_call = None
        success = True
        try:
            runner_method = self.get_runner_method(request_item)
            method_to_call = sync_to_async(runner_method)
            result = None
            if len(inspect.signature(runner_method).parameters) > 0:
                result = await method_to_call(*args, **kwargs)
            else:
                # The method doesn't take in anything, including the request
                # information, so we pass nothing into it
                result = await method_to_call()

            result = await self.ensure_serializable_response(result)
            self.request_counter.inc()
        except Exception as e:
            logger.exception(f"Request failed due to {type(e).__name__}:")
            success = False
            if "RAY_PDB" in os.environ:
                ray.util.pdb.post_mortem()
            function_name = "unknown"
            if method_to_call is not None:
                function_name = method_to_call.__name__
            result = wrap_to_ray_error(function_name, e)
            self.error_counter.inc()

        return result, success
Executes the provided request on this replica.

        Returns the user-provided output and a boolean indicating if the
        request succeeded (user code didn't raise an exception).
        
Executes the provided request on this replica.
Returns the user-provided output and a boolean indicating if the
request succeeded (user code didn't raise an exception).
Executes the provided request on this replica . Returns the user - provided output and a boolean indicating if the request succeeded ( user code didn ' t raise an exception ) .
async def invoke_single(self, request_item: Query) -> Tuple[Any, bool]:
        logger.debug(
            "Replica {} started executing request {}".format(
                self.replica_tag, request_item.metadata.request_id
            )
        )
        args, kwargs = parse_request_item(request_item)
        method_to_call = None
        success = True
        try:
            runner_method = self.get_runner_method(request_item)
            method_to_call = sync_to_async(runner_method)
            result = None
            if len(inspect.signature(runner_method).parameters) > 0:
                result = await method_to_call(*args, **kwargs)
            else:
                result = await method_to_call()
            result = await self.ensure_serializable_response(result)
            self.request_counter.inc()
        except Exception as e:
            logger.exception(f"Request failed due to {type(e).__name__}:")
            success = False
            if "RAY_PDB" in os.environ:
                ray.util.pdb.post_mortem()
            function_name = "unknown"
            if method_to_call is not None:
                function_name = method_to_call.__name__
            result = wrap_to_ray_error(function_name, e)
            self.error_counter.inc()
        return result, success
async def invoke_single ( self , request_item : Query ) -> Tuple [ Any , bool ] : logger . debug ( "Replica {} started executing request {}" . format ( self . replica_tag , request_item . metadata . request_id ) ) args , kwargs = parse_request_item ( request_item ) method_to_call = None success = True try : runner_method = self . get_runner_method ( request_item ) method_to_call = sync_to_async ( runner_method ) result = None if len ( inspect . signature ( runner_method ) . parameters ) > 0 : result = await method_to_call ( * args , ** kwargs ) else : result = await method_to_call ( ) result = await self . ensure_serializable_response ( result ) self . request_counter . inc ( ) except Exception as e : logger . exception ( f"Request failed due to {type(e).__name__}:" ) success = False if "RAY_PDB" in os . environ : ray . util . pdb . post_mortem ( ) function_name = "unknown" if method_to_call is not None : function_name = method_to_call . __name__ result = wrap_to_ray_error ( function_name , e ) self . error_counter . inc ( ) return result , success
Executes the provided request on this replica.
Executes the provided request on this replica .
"""Executes the provided request on this replica.

        Returns the user-provided output and a boolean indicating if the
        request succeeded (user code didn't raise an exception).
        """ # The method doesn't take in anything, including the request # information, so we pass nothing into it
self
request_item
Query