MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / _call_future

Method _call_future

tensorrt_llm/executor/rpc/rpc_client.py:541–561  ·  view source on GitHub ↗

Call a remote method and return a Future. Args: name: Method name to call *args: Positional arguments **kwargs: Keyword arguments Returns: A Future object that can be used to retrieve the result

(self, name: str, *args,
                     **kwargs)

Source from the content-addressed store, hash-verified

539 return result
540
541 def _call_future(self, name: str, *args,
542 **kwargs) -> concurrent.futures.Future:
543 """
544 Call a remote method and return a Future.
545
546 Args:
547 name: Method name to call
548 *args: Positional arguments
549 **kwargs: Keyword arguments
550
551 Returns:
552 A Future object that can be used to retrieve the result
553 """
554 nvtx_mark_debug(f"RPC.future.{name}", color="blue", category="RPC")
555
556 def _async_to_sync():
557 future = asyncio.run_coroutine_threadsafe(
558 self._call_async(name, *args, **kwargs), self._loop)
559 return future.result()
560
561 return self._executor.submit(_async_to_sync)
562
563 async def _call_streaming(self, name: str, *args,
564 **kwargs) -> AsyncIterator[Any]:

Callers

nothing calls this directly

Calls 2

nvtx_mark_debugFunction · 0.90
submitMethod · 0.45

Tested by

no test coverage detected