run_endpoint_function
Executes a given dependant function, either directly if it's a coroutine or within a threadpool if it's a synchronous function, passing the provided values as arguments.
def run_endpoint_function(
dependant: Dependant,
values: dict[str, Any],
is_coroutine: bool
) - > Any
Executes a given function, either directly if it's a coroutine or within a thread pool otherwise, to handle an endpoint request. This function is used internally by get_request_handler to facilitate profiling.
Parameters
| Name | Type | Description |
|---|---|---|
| dependant | Dependant | An object containing the function to be called. It must have a callable attribute named call. |
| values | dict[str, Any] | A dictionary of keyword arguments to be passed to the dependant.call function. |
| is_coroutine | bool | A boolean indicating whether the dependant.call function is a coroutine. If true, it will be awaited directly; otherwise, it will be run in a thread pool. |
Returns
| Type | Description |
|---|---|
Any | The result of the executed function. |